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.
 
 
 

1812 lines
68 KiB

  1. // Package firebasedynamiclinks provides access to the Firebase Dynamic Links API.
  2. //
  3. // See https://firebase.google.com/docs/dynamic-links/
  4. //
  5. // Usage example:
  6. //
  7. // import "google.golang.org/api/firebasedynamiclinks/v1"
  8. // ...
  9. // firebasedynamiclinksService, err := firebasedynamiclinks.New(oauthHttpClient)
  10. package firebasedynamiclinks // import "google.golang.org/api/firebasedynamiclinks/v1"
  11. import (
  12. "bytes"
  13. "encoding/json"
  14. "errors"
  15. "fmt"
  16. context "golang.org/x/net/context"
  17. ctxhttp "golang.org/x/net/context/ctxhttp"
  18. gensupport "google.golang.org/api/gensupport"
  19. googleapi "google.golang.org/api/googleapi"
  20. "io"
  21. "net/http"
  22. "net/url"
  23. "strconv"
  24. "strings"
  25. )
  26. // Always reference these packages, just in case the auto-generated code
  27. // below doesn't.
  28. var _ = bytes.NewBuffer
  29. var _ = strconv.Itoa
  30. var _ = fmt.Sprintf
  31. var _ = json.NewDecoder
  32. var _ = io.Copy
  33. var _ = url.Parse
  34. var _ = gensupport.MarshalJSON
  35. var _ = googleapi.Version
  36. var _ = errors.New
  37. var _ = strings.Replace
  38. var _ = context.Canceled
  39. var _ = ctxhttp.Do
  40. const apiId = "firebasedynamiclinks:v1"
  41. const apiName = "firebasedynamiclinks"
  42. const apiVersion = "v1"
  43. const basePath = "https://firebasedynamiclinks.googleapis.com/"
  44. // OAuth2 scopes used by this API.
  45. const (
  46. // View and administer all your Firebase data and settings
  47. FirebaseScope = "https://www.googleapis.com/auth/firebase"
  48. )
  49. func New(client *http.Client) (*Service, error) {
  50. if client == nil {
  51. return nil, errors.New("client is nil")
  52. }
  53. s := &Service{client: client, BasePath: basePath}
  54. s.ManagedShortLinks = NewManagedShortLinksService(s)
  55. s.ShortLinks = NewShortLinksService(s)
  56. s.V1 = NewV1Service(s)
  57. return s, nil
  58. }
  59. type Service struct {
  60. client *http.Client
  61. BasePath string // API endpoint base URL
  62. UserAgent string // optional additional User-Agent fragment
  63. ManagedShortLinks *ManagedShortLinksService
  64. ShortLinks *ShortLinksService
  65. V1 *V1Service
  66. }
  67. func (s *Service) userAgent() string {
  68. if s.UserAgent == "" {
  69. return googleapi.UserAgent
  70. }
  71. return googleapi.UserAgent + " " + s.UserAgent
  72. }
  73. func NewManagedShortLinksService(s *Service) *ManagedShortLinksService {
  74. rs := &ManagedShortLinksService{s: s}
  75. return rs
  76. }
  77. type ManagedShortLinksService struct {
  78. s *Service
  79. }
  80. func NewShortLinksService(s *Service) *ShortLinksService {
  81. rs := &ShortLinksService{s: s}
  82. return rs
  83. }
  84. type ShortLinksService struct {
  85. s *Service
  86. }
  87. func NewV1Service(s *Service) *V1Service {
  88. rs := &V1Service{s: s}
  89. return rs
  90. }
  91. type V1Service struct {
  92. s *Service
  93. }
  94. // AnalyticsInfo: Tracking parameters supported by Dynamic Link.
  95. type AnalyticsInfo struct {
  96. // GooglePlayAnalytics: Google Play Campaign Measurements.
  97. GooglePlayAnalytics *GooglePlayAnalytics `json:"googlePlayAnalytics,omitempty"`
  98. // ItunesConnectAnalytics: iTunes Connect App Analytics.
  99. ItunesConnectAnalytics *ITunesConnectAnalytics `json:"itunesConnectAnalytics,omitempty"`
  100. // ForceSendFields is a list of field names (e.g. "GooglePlayAnalytics")
  101. // to unconditionally include in API requests. By default, fields with
  102. // empty values are omitted from API requests. However, any non-pointer,
  103. // non-interface field appearing in ForceSendFields will be sent to the
  104. // server regardless of whether the field is empty or not. This may be
  105. // used to include empty fields in Patch requests.
  106. ForceSendFields []string `json:"-"`
  107. // NullFields is a list of field names (e.g. "GooglePlayAnalytics") to
  108. // include in API requests with the JSON null value. By default, fields
  109. // with empty values are omitted from API requests. However, any field
  110. // with an empty value appearing in NullFields will be sent to the
  111. // server as null. It is an error if a field in this list has a
  112. // non-empty value. This may be used to include null fields in Patch
  113. // requests.
  114. NullFields []string `json:"-"`
  115. }
  116. func (s *AnalyticsInfo) MarshalJSON() ([]byte, error) {
  117. type NoMethod AnalyticsInfo
  118. raw := NoMethod(*s)
  119. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  120. }
  121. // AndroidInfo: Android related attributes to the Dynamic Link.
  122. type AndroidInfo struct {
  123. // AndroidFallbackLink: Link to open on Android if the app is not
  124. // installed.
  125. AndroidFallbackLink string `json:"androidFallbackLink,omitempty"`
  126. // AndroidLink: If specified, this overrides the ‘link’ parameter on
  127. // Android.
  128. AndroidLink string `json:"androidLink,omitempty"`
  129. // AndroidMinPackageVersionCode: Minimum version code for the Android
  130. // app. If the installed app’s version
  131. // code is lower, then the user is taken to the Play Store.
  132. AndroidMinPackageVersionCode string `json:"androidMinPackageVersionCode,omitempty"`
  133. // AndroidPackageName: Android package name of the app.
  134. AndroidPackageName string `json:"androidPackageName,omitempty"`
  135. // ForceSendFields is a list of field names (e.g. "AndroidFallbackLink")
  136. // to unconditionally include in API requests. By default, fields with
  137. // empty values are omitted from API requests. However, any non-pointer,
  138. // non-interface field appearing in ForceSendFields will be sent to the
  139. // server regardless of whether the field is empty or not. This may be
  140. // used to include empty fields in Patch requests.
  141. ForceSendFields []string `json:"-"`
  142. // NullFields is a list of field names (e.g. "AndroidFallbackLink") to
  143. // include in API requests with the JSON null value. By default, fields
  144. // with empty values are omitted from API requests. However, any field
  145. // with an empty value appearing in NullFields will be sent to the
  146. // server as null. It is an error if a field in this list has a
  147. // non-empty value. This may be used to include null fields in Patch
  148. // requests.
  149. NullFields []string `json:"-"`
  150. }
  151. func (s *AndroidInfo) MarshalJSON() ([]byte, error) {
  152. type NoMethod AndroidInfo
  153. raw := NoMethod(*s)
  154. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  155. }
  156. // CreateManagedShortLinkRequest: Request to create a managed Short
  157. // Dynamic Link.
  158. type CreateManagedShortLinkRequest struct {
  159. // DynamicLinkInfo: Information about the Dynamic Link to be
  160. // shortened.
  161. // [Learn
  162. // more](https://firebase.google.com/docs/reference/dynamic-links/link-sh
  163. // ortener).
  164. DynamicLinkInfo *DynamicLinkInfo `json:"dynamicLinkInfo,omitempty"`
  165. // LongDynamicLink: Full long Dynamic Link URL with desired query
  166. // parameters specified.
  167. // For
  168. // example,
  169. // "https://sample.app.goo.gl/?link=http://www.google.com&apn=co
  170. // m.sample",
  171. // [Learn
  172. // more](https://firebase.google.com/docs/reference/dynamic-links/link-sh
  173. // ortener).
  174. LongDynamicLink string `json:"longDynamicLink,omitempty"`
  175. // Name: Link name to associate with the link. It's used for marketer to
  176. // identify
  177. // manually-created links in the Firebase
  178. // console
  179. // (https://console.firebase.google.com/).
  180. // Links must be named to be tracked.
  181. Name string `json:"name,omitempty"`
  182. // Suffix: Short Dynamic Link suffix. Optional.
  183. Suffix *Suffix `json:"suffix,omitempty"`
  184. // ForceSendFields is a list of field names (e.g. "DynamicLinkInfo") to
  185. // unconditionally include in API requests. By default, fields with
  186. // empty values are omitted from API requests. However, any non-pointer,
  187. // non-interface field appearing in ForceSendFields will be sent to the
  188. // server regardless of whether the field is empty or not. This may be
  189. // used to include empty fields in Patch requests.
  190. ForceSendFields []string `json:"-"`
  191. // NullFields is a list of field names (e.g. "DynamicLinkInfo") to
  192. // include in API requests with the JSON null value. By default, fields
  193. // with empty values are omitted from API requests. However, any field
  194. // with an empty value appearing in NullFields will be sent to the
  195. // server as null. It is an error if a field in this list has a
  196. // non-empty value. This may be used to include null fields in Patch
  197. // requests.
  198. NullFields []string `json:"-"`
  199. }
  200. func (s *CreateManagedShortLinkRequest) MarshalJSON() ([]byte, error) {
  201. type NoMethod CreateManagedShortLinkRequest
  202. raw := NoMethod(*s)
  203. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  204. }
  205. // CreateManagedShortLinkResponse: Response to create a short Dynamic
  206. // Link.
  207. type CreateManagedShortLinkResponse struct {
  208. // ManagedShortLink: Short Dynamic Link value. e.g.
  209. // https://abcd.app.goo.gl/wxyz
  210. ManagedShortLink *ManagedShortLink `json:"managedShortLink,omitempty"`
  211. // PreviewLink: Preview link to show the link flow chart. (debug info.)
  212. PreviewLink string `json:"previewLink,omitempty"`
  213. // Warning: Information about potential warnings on link creation.
  214. Warning []*DynamicLinkWarning `json:"warning,omitempty"`
  215. // ServerResponse contains the HTTP response code and headers from the
  216. // server.
  217. googleapi.ServerResponse `json:"-"`
  218. // ForceSendFields is a list of field names (e.g. "ManagedShortLink") to
  219. // unconditionally include in API requests. By default, fields with
  220. // empty values are omitted from API requests. However, any non-pointer,
  221. // non-interface field appearing in ForceSendFields will be sent to the
  222. // server regardless of whether the field is empty or not. This may be
  223. // used to include empty fields in Patch requests.
  224. ForceSendFields []string `json:"-"`
  225. // NullFields is a list of field names (e.g. "ManagedShortLink") to
  226. // include in API requests with the JSON null value. By default, fields
  227. // with empty values are omitted from API requests. However, any field
  228. // with an empty value appearing in NullFields will be sent to the
  229. // server as null. It is an error if a field in this list has a
  230. // non-empty value. This may be used to include null fields in Patch
  231. // requests.
  232. NullFields []string `json:"-"`
  233. }
  234. func (s *CreateManagedShortLinkResponse) MarshalJSON() ([]byte, error) {
  235. type NoMethod CreateManagedShortLinkResponse
  236. raw := NoMethod(*s)
  237. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  238. }
  239. // CreateShortDynamicLinkRequest: Request to create a short Dynamic
  240. // Link.
  241. type CreateShortDynamicLinkRequest struct {
  242. // DynamicLinkInfo: Information about the Dynamic Link to be
  243. // shortened.
  244. // [Learn
  245. // more](https://firebase.google.com/docs/reference/dynamic-links/link-sh
  246. // ortener).
  247. DynamicLinkInfo *DynamicLinkInfo `json:"dynamicLinkInfo,omitempty"`
  248. // LongDynamicLink: Full long Dynamic Link URL with desired query
  249. // parameters specified.
  250. // For
  251. // example,
  252. // "https://sample.app.goo.gl/?link=http://www.google.com&apn=co
  253. // m.sample",
  254. // [Learn
  255. // more](https://firebase.google.com/docs/reference/dynamic-links/link-sh
  256. // ortener).
  257. LongDynamicLink string `json:"longDynamicLink,omitempty"`
  258. // Suffix: Short Dynamic Link suffix. Optional.
  259. Suffix *Suffix `json:"suffix,omitempty"`
  260. // ForceSendFields is a list of field names (e.g. "DynamicLinkInfo") to
  261. // unconditionally include in API requests. By default, fields with
  262. // empty values are omitted from API requests. However, any non-pointer,
  263. // non-interface field appearing in ForceSendFields will be sent to the
  264. // server regardless of whether the field is empty or not. This may be
  265. // used to include empty fields in Patch requests.
  266. ForceSendFields []string `json:"-"`
  267. // NullFields is a list of field names (e.g. "DynamicLinkInfo") to
  268. // include in API requests with the JSON null value. By default, fields
  269. // with empty values are omitted from API requests. However, any field
  270. // with an empty value appearing in NullFields will be sent to the
  271. // server as null. It is an error if a field in this list has a
  272. // non-empty value. This may be used to include null fields in Patch
  273. // requests.
  274. NullFields []string `json:"-"`
  275. }
  276. func (s *CreateShortDynamicLinkRequest) MarshalJSON() ([]byte, error) {
  277. type NoMethod CreateShortDynamicLinkRequest
  278. raw := NoMethod(*s)
  279. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  280. }
  281. // CreateShortDynamicLinkResponse: Response to create a short Dynamic
  282. // Link.
  283. type CreateShortDynamicLinkResponse struct {
  284. // PreviewLink: Preview link to show the link flow chart. (debug info.)
  285. PreviewLink string `json:"previewLink,omitempty"`
  286. // ShortLink: Short Dynamic Link value. e.g.
  287. // https://abcd.app.goo.gl/wxyz
  288. ShortLink string `json:"shortLink,omitempty"`
  289. // Warning: Information about potential warnings on link creation.
  290. Warning []*DynamicLinkWarning `json:"warning,omitempty"`
  291. // ServerResponse contains the HTTP response code and headers from the
  292. // server.
  293. googleapi.ServerResponse `json:"-"`
  294. // ForceSendFields is a list of field names (e.g. "PreviewLink") to
  295. // unconditionally include in API requests. By default, fields with
  296. // empty values are omitted from API requests. However, any non-pointer,
  297. // non-interface field appearing in ForceSendFields will be sent to the
  298. // server regardless of whether the field is empty or not. This may be
  299. // used to include empty fields in Patch requests.
  300. ForceSendFields []string `json:"-"`
  301. // NullFields is a list of field names (e.g. "PreviewLink") to include
  302. // in API requests with the JSON null value. By default, fields with
  303. // empty values are omitted from API requests. However, any field with
  304. // an empty value appearing in NullFields will be sent to the server as
  305. // null. It is an error if a field in this list has a non-empty value.
  306. // This may be used to include null fields in Patch requests.
  307. NullFields []string `json:"-"`
  308. }
  309. func (s *CreateShortDynamicLinkResponse) MarshalJSON() ([]byte, error) {
  310. type NoMethod CreateShortDynamicLinkResponse
  311. raw := NoMethod(*s)
  312. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  313. }
  314. // DesktopInfo: Desktop related attributes to the Dynamic Link.
  315. type DesktopInfo struct {
  316. // DesktopFallbackLink: Link to open on desktop.
  317. DesktopFallbackLink string `json:"desktopFallbackLink,omitempty"`
  318. // ForceSendFields is a list of field names (e.g. "DesktopFallbackLink")
  319. // to unconditionally include in API requests. By default, fields with
  320. // empty values are omitted from API requests. However, any non-pointer,
  321. // non-interface field appearing in ForceSendFields will be sent to the
  322. // server regardless of whether the field is empty or not. This may be
  323. // used to include empty fields in Patch requests.
  324. ForceSendFields []string `json:"-"`
  325. // NullFields is a list of field names (e.g. "DesktopFallbackLink") to
  326. // include in API requests with the JSON null value. By default, fields
  327. // with empty values are omitted from API requests. However, any field
  328. // with an empty value appearing in NullFields will be sent to the
  329. // server as null. It is an error if a field in this list has a
  330. // non-empty value. This may be used to include null fields in Patch
  331. // requests.
  332. NullFields []string `json:"-"`
  333. }
  334. func (s *DesktopInfo) MarshalJSON() ([]byte, error) {
  335. type NoMethod DesktopInfo
  336. raw := NoMethod(*s)
  337. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  338. }
  339. // DeviceInfo: Signals associated with the device making the request.
  340. type DeviceInfo struct {
  341. // DeviceModelName: Device model name.
  342. DeviceModelName string `json:"deviceModelName,omitempty"`
  343. // LanguageCode: Device language code setting.
  344. LanguageCode string `json:"languageCode,omitempty"`
  345. // LanguageCodeFromWebview: Device language code setting obtained by
  346. // executing JavaScript code in
  347. // WebView.
  348. LanguageCodeFromWebview string `json:"languageCodeFromWebview,omitempty"`
  349. // LanguageCodeRaw: Device language code raw setting.
  350. // iOS does returns language code in different format than iOS
  351. // WebView.
  352. // For example WebView returns en_US, but iOS returns en-US.
  353. // Field below will return raw value returned by iOS.
  354. LanguageCodeRaw string `json:"languageCodeRaw,omitempty"`
  355. // ScreenResolutionHeight: Device display resolution height.
  356. ScreenResolutionHeight int64 `json:"screenResolutionHeight,omitempty,string"`
  357. // ScreenResolutionWidth: Device display resolution width.
  358. ScreenResolutionWidth int64 `json:"screenResolutionWidth,omitempty,string"`
  359. // Timezone: Device timezone setting.
  360. Timezone string `json:"timezone,omitempty"`
  361. // ForceSendFields is a list of field names (e.g. "DeviceModelName") to
  362. // unconditionally include in API requests. By default, fields with
  363. // empty values are omitted from API requests. However, any non-pointer,
  364. // non-interface field appearing in ForceSendFields will be sent to the
  365. // server regardless of whether the field is empty or not. This may be
  366. // used to include empty fields in Patch requests.
  367. ForceSendFields []string `json:"-"`
  368. // NullFields is a list of field names (e.g. "DeviceModelName") to
  369. // include in API requests with the JSON null value. By default, fields
  370. // with empty values are omitted from API requests. However, any field
  371. // with an empty value appearing in NullFields will be sent to the
  372. // server as null. It is an error if a field in this list has a
  373. // non-empty value. This may be used to include null fields in Patch
  374. // requests.
  375. NullFields []string `json:"-"`
  376. }
  377. func (s *DeviceInfo) MarshalJSON() ([]byte, error) {
  378. type NoMethod DeviceInfo
  379. raw := NoMethod(*s)
  380. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  381. }
  382. // DynamicLinkEventStat: Dynamic Link event stat.
  383. type DynamicLinkEventStat struct {
  384. // Count: The number of times this event occurred.
  385. Count int64 `json:"count,omitempty,string"`
  386. // Event: Link event.
  387. //
  388. // Possible values:
  389. // "DYNAMIC_LINK_EVENT_UNSPECIFIED" - Unspecified type.
  390. // "CLICK" - Indicates that an FDL is clicked by users.
  391. // "REDIRECT" - Indicates that an FDL redirects users to fallback
  392. // link.
  393. // "APP_INSTALL" - Indicates that an FDL triggers an app install from
  394. // Play store, currently
  395. // it's impossible to get stats from App store.
  396. // "APP_FIRST_OPEN" - Indicates that the app is opened for the first
  397. // time after an install
  398. // triggered by FDLs
  399. // "APP_RE_OPEN" - Indicates that the app is opened via an FDL for
  400. // non-first time.
  401. Event string `json:"event,omitempty"`
  402. // Platform: Requested platform.
  403. //
  404. // Possible values:
  405. // "DYNAMIC_LINK_PLATFORM_UNSPECIFIED" - Unspecified platform.
  406. // "ANDROID" - Represents Android platform.
  407. // All apps and browsers on Android are classfied in this category.
  408. // "IOS" - Represents iOS platform.
  409. // All apps and browsers on iOS are classfied in this category.
  410. // "DESKTOP" - Represents desktop.
  411. // "OTHER" - Platforms are not categorized as Android/iOS/Destop fall
  412. // into here.
  413. Platform string `json:"platform,omitempty"`
  414. // ForceSendFields is a list of field names (e.g. "Count") to
  415. // unconditionally include in API requests. By default, fields with
  416. // empty values are omitted from API requests. However, any non-pointer,
  417. // non-interface field appearing in ForceSendFields will be sent to the
  418. // server regardless of whether the field is empty or not. This may be
  419. // used to include empty fields in Patch requests.
  420. ForceSendFields []string `json:"-"`
  421. // NullFields is a list of field names (e.g. "Count") to include in API
  422. // requests with the JSON null value. By default, fields with empty
  423. // values are omitted from API requests. However, any field with an
  424. // empty value appearing in NullFields will be sent to the server as
  425. // null. It is an error if a field in this list has a non-empty value.
  426. // This may be used to include null fields in Patch requests.
  427. NullFields []string `json:"-"`
  428. }
  429. func (s *DynamicLinkEventStat) MarshalJSON() ([]byte, error) {
  430. type NoMethod DynamicLinkEventStat
  431. raw := NoMethod(*s)
  432. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  433. }
  434. // DynamicLinkInfo: Information about a Dynamic Link.
  435. type DynamicLinkInfo struct {
  436. // AnalyticsInfo: Parameters used for tracking. See all tracking
  437. // parameters in
  438. // the
  439. // [documentation](https://firebase.google.com/docs/dynamic-links/cre
  440. // ate-manually).
  441. AnalyticsInfo *AnalyticsInfo `json:"analyticsInfo,omitempty"`
  442. // AndroidInfo: Android related information. See Android related
  443. // parameters in
  444. // the
  445. // [documentation](https://firebase.google.com/docs/dynamic-links/cre
  446. // ate-manually).
  447. AndroidInfo *AndroidInfo `json:"androidInfo,omitempty"`
  448. // DesktopInfo: Desktop related information. See desktop related
  449. // parameters in
  450. // the
  451. // [documentation](https://firebase.google.com/docs/dynamic-links/cre
  452. // ate-manually).
  453. DesktopInfo *DesktopInfo `json:"desktopInfo,omitempty"`
  454. // DomainUriPrefix: E.g. https://maps.app.goo.gl,
  455. // https://maps.page.link, https://g.co/maps
  456. // More examples can be found in description of getNormalizedUriPrefix
  457. // in
  458. // j/c/g/firebase/dynamiclinks/uri/DdlDomain.java
  459. DomainUriPrefix string `json:"domainUriPrefix,omitempty"`
  460. // DynamicLinkDomain: Dynamic Links domain that the project owns, e.g.
  461. // abcd.app.goo.gl
  462. // [Learn
  463. // more](https://firebase.google.com/docs/dynamic-links/android/receive)
  464. //
  465. // on how to set up Dynamic Link domain associated with your Firebase
  466. // project.
  467. //
  468. // Required.
  469. DynamicLinkDomain string `json:"dynamicLinkDomain,omitempty"`
  470. // IosInfo: iOS related information. See iOS related parameters in
  471. // the
  472. // [documentation](https://firebase.google.com/docs/dynamic-links/cre
  473. // ate-manually).
  474. IosInfo *IosInfo `json:"iosInfo,omitempty"`
  475. // Link: The link your app will open, You can specify any URL your app
  476. // can handle.
  477. // This link must be a well-formatted URL, be properly URL-encoded, and
  478. // use
  479. // the HTTP or HTTPS scheme. See 'link' parameters in
  480. // the
  481. // [documentation](https://firebase.google.com/docs/dynamic-links/cre
  482. // ate-manually).
  483. //
  484. // Required.
  485. Link string `json:"link,omitempty"`
  486. // NavigationInfo: Information of navigation behavior of a Firebase
  487. // Dynamic Links.
  488. NavigationInfo *NavigationInfo `json:"navigationInfo,omitempty"`
  489. // SocialMetaTagInfo: Parameters for social meta tag params.
  490. // Used to set meta tag data for link previews on social sites.
  491. SocialMetaTagInfo *SocialMetaTagInfo `json:"socialMetaTagInfo,omitempty"`
  492. // ForceSendFields is a list of field names (e.g. "AnalyticsInfo") to
  493. // unconditionally include in API requests. By default, fields with
  494. // empty values are omitted from API requests. However, any non-pointer,
  495. // non-interface field appearing in ForceSendFields will be sent to the
  496. // server regardless of whether the field is empty or not. This may be
  497. // used to include empty fields in Patch requests.
  498. ForceSendFields []string `json:"-"`
  499. // NullFields is a list of field names (e.g. "AnalyticsInfo") to include
  500. // in API requests with the JSON null value. By default, fields with
  501. // empty values are omitted from API requests. However, any field with
  502. // an empty value appearing in NullFields will be sent to the server as
  503. // null. It is an error if a field in this list has a non-empty value.
  504. // This may be used to include null fields in Patch requests.
  505. NullFields []string `json:"-"`
  506. }
  507. func (s *DynamicLinkInfo) MarshalJSON() ([]byte, error) {
  508. type NoMethod DynamicLinkInfo
  509. raw := NoMethod(*s)
  510. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  511. }
  512. // DynamicLinkStats: Analytics stats of a Dynamic Link for a given
  513. // timeframe.
  514. type DynamicLinkStats struct {
  515. // LinkEventStats: Dynamic Link event stats.
  516. LinkEventStats []*DynamicLinkEventStat `json:"linkEventStats,omitempty"`
  517. // ServerResponse contains the HTTP response code and headers from the
  518. // server.
  519. googleapi.ServerResponse `json:"-"`
  520. // ForceSendFields is a list of field names (e.g. "LinkEventStats") to
  521. // unconditionally include in API requests. By default, fields with
  522. // empty values are omitted from API requests. However, any non-pointer,
  523. // non-interface field appearing in ForceSendFields will be sent to the
  524. // server regardless of whether the field is empty or not. This may be
  525. // used to include empty fields in Patch requests.
  526. ForceSendFields []string `json:"-"`
  527. // NullFields is a list of field names (e.g. "LinkEventStats") to
  528. // include in API requests with the JSON null value. By default, fields
  529. // with empty values are omitted from API requests. However, any field
  530. // with an empty value appearing in NullFields will be sent to the
  531. // server as null. It is an error if a field in this list has a
  532. // non-empty value. This may be used to include null fields in Patch
  533. // requests.
  534. NullFields []string `json:"-"`
  535. }
  536. func (s *DynamicLinkStats) MarshalJSON() ([]byte, error) {
  537. type NoMethod DynamicLinkStats
  538. raw := NoMethod(*s)
  539. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  540. }
  541. // DynamicLinkWarning: Dynamic Links warning messages.
  542. type DynamicLinkWarning struct {
  543. // WarningCode: The warning code.
  544. //
  545. // Possible values:
  546. // "CODE_UNSPECIFIED" - Unknown code.
  547. // "NOT_IN_PROJECT_ANDROID_PACKAGE_NAME" - The Android package does
  548. // not match any in developer's DevConsole project.
  549. // "NOT_INTEGER_ANDROID_PACKAGE_MIN_VERSION" - The Android minimum
  550. // version code has to be a valid integer.
  551. // "UNNECESSARY_ANDROID_PACKAGE_MIN_VERSION" - Android package min
  552. // version param is not needed, e.g. when
  553. // 'apn' is missing.
  554. // "NOT_URI_ANDROID_LINK" - Android link is not a valid URI.
  555. // "UNNECESSARY_ANDROID_LINK" - Android link param is not needed, e.g.
  556. // when param 'al' and 'link' have
  557. // the same value..
  558. // "NOT_URI_ANDROID_FALLBACK_LINK" - Android fallback link is not a
  559. // valid URI.
  560. // "BAD_URI_SCHEME_ANDROID_FALLBACK_LINK" - Android fallback link has
  561. // an invalid (non http/https) URI scheme.
  562. // "NOT_IN_PROJECT_IOS_BUNDLE_ID" - The iOS bundle ID does not match
  563. // any in developer's DevConsole project.
  564. // "NOT_IN_PROJECT_IPAD_BUNDLE_ID" - The iPad bundle ID does not match
  565. // any in developer's DevConsole project.
  566. // "UNNECESSARY_IOS_URL_SCHEME" - iOS URL scheme is not needed, e.g.
  567. // when 'ibi' are 'ipbi' are all missing.
  568. // "NOT_NUMERIC_IOS_APP_STORE_ID" - iOS app store ID format is
  569. // incorrect, e.g. not numeric.
  570. // "UNNECESSARY_IOS_APP_STORE_ID" - iOS app store ID is not needed.
  571. // "NOT_URI_IOS_FALLBACK_LINK" - iOS fallback link is not a valid URI.
  572. // "BAD_URI_SCHEME_IOS_FALLBACK_LINK" - iOS fallback link has an
  573. // invalid (non http/https) URI scheme.
  574. // "NOT_URI_IPAD_FALLBACK_LINK" - iPad fallback link is not a valid
  575. // URI.
  576. // "BAD_URI_SCHEME_IPAD_FALLBACK_LINK" - iPad fallback link has an
  577. // invalid (non http/https) URI scheme.
  578. // "BAD_DEBUG_PARAM" - Debug param format is incorrect.
  579. // "BAD_AD_PARAM" - isAd param format is incorrect.
  580. // "DEPRECATED_PARAM" - Indicates a certain param is deprecated.
  581. // "UNRECOGNIZED_PARAM" - Indicates certain paramater is not
  582. // recognized.
  583. // "TOO_LONG_PARAM" - Indicates certain paramater is too long.
  584. // "NOT_URI_SOCIAL_IMAGE_LINK" - Social meta tag image link is not a
  585. // valid URI.
  586. // "BAD_URI_SCHEME_SOCIAL_IMAGE_LINK" - Social meta tag image link has
  587. // an invalid (non http/https) URI scheme.
  588. // "NOT_URI_SOCIAL_URL"
  589. // "BAD_URI_SCHEME_SOCIAL_URL"
  590. // "LINK_LENGTH_TOO_LONG" - Dynamic Link URL length is too long.
  591. // "LINK_WITH_FRAGMENTS" - Dynamic Link URL contains fragments.
  592. // "NOT_MATCHING_IOS_BUNDLE_ID_AND_STORE_ID" - The iOS bundle ID does
  593. // not match with the given iOS store ID.
  594. WarningCode string `json:"warningCode,omitempty"`
  595. // WarningDocumentLink: The document describing the warning, and helps
  596. // resolve.
  597. WarningDocumentLink string `json:"warningDocumentLink,omitempty"`
  598. // WarningMessage: The warning message to help developers improve their
  599. // requests.
  600. WarningMessage string `json:"warningMessage,omitempty"`
  601. // ForceSendFields is a list of field names (e.g. "WarningCode") to
  602. // unconditionally include in API requests. By default, fields with
  603. // empty values are omitted from API requests. However, any non-pointer,
  604. // non-interface field appearing in ForceSendFields will be sent to the
  605. // server regardless of whether the field is empty or not. This may be
  606. // used to include empty fields in Patch requests.
  607. ForceSendFields []string `json:"-"`
  608. // NullFields is a list of field names (e.g. "WarningCode") to include
  609. // in API requests with the JSON null value. By default, fields with
  610. // empty values are omitted from API requests. However, any field with
  611. // an empty value appearing in NullFields will be sent to the server as
  612. // null. It is an error if a field in this list has a non-empty value.
  613. // This may be used to include null fields in Patch requests.
  614. NullFields []string `json:"-"`
  615. }
  616. func (s *DynamicLinkWarning) MarshalJSON() ([]byte, error) {
  617. type NoMethod DynamicLinkWarning
  618. raw := NoMethod(*s)
  619. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  620. }
  621. // GetIosPostInstallAttributionRequest: Request for iSDK to execute
  622. // strong match flow for post-install attribution.
  623. // This is meant for iOS requests only. Requests from other platforms
  624. // will
  625. // not be honored.
  626. type GetIosPostInstallAttributionRequest struct {
  627. // AppInstallationTime: App installation epoch time
  628. // (https://en.wikipedia.org/wiki/Unix_time).
  629. // This is a client signal for a more accurate weak match.
  630. AppInstallationTime int64 `json:"appInstallationTime,omitempty,string"`
  631. // BundleId: APP bundle ID.
  632. BundleId string `json:"bundleId,omitempty"`
  633. // Device: Device information.
  634. Device *DeviceInfo `json:"device,omitempty"`
  635. // IosVersion: iOS version, ie: 9.3.5.
  636. // Consider adding "build".
  637. IosVersion string `json:"iosVersion,omitempty"`
  638. // RetrievalMethod: App post install attribution retrieval information.
  639. // Disambiguates
  640. // mechanism (iSDK or developer invoked) to retrieve payload
  641. // from
  642. // clicked link.
  643. //
  644. // Possible values:
  645. // "UNKNOWN_PAYLOAD_RETRIEVAL_METHOD" - Unknown method.
  646. // "IMPLICIT_WEAK_MATCH" - iSDK performs a server lookup by device
  647. // fingerprint in the background
  648. // when app is first-opened; no API called by developer.
  649. // "EXPLICIT_WEAK_MATCH" - iSDK performs a server lookup by device
  650. // fingerprint upon a dev API call.
  651. // "EXPLICIT_STRONG_AFTER_WEAK_MATCH" - iSDK performs a strong match
  652. // only if weak match is found upon a dev
  653. // API call.
  654. RetrievalMethod string `json:"retrievalMethod,omitempty"`
  655. // SdkVersion: Google SDK version.
  656. SdkVersion string `json:"sdkVersion,omitempty"`
  657. // UniqueMatchLinkToCheck: Possible unique matched link that server need
  658. // to check before performing
  659. // fingerprint match. If passed link is short server need to expand the
  660. // link.
  661. // If link is long server need to vslidate the link.
  662. UniqueMatchLinkToCheck string `json:"uniqueMatchLinkToCheck,omitempty"`
  663. // VisualStyle: Strong match page information. Disambiguates between
  664. // default UI and
  665. // custom page to present when strong match succeeds/fails to find
  666. // cookie.
  667. //
  668. // Possible values:
  669. // "UNKNOWN_VISUAL_STYLE" - Unknown style.
  670. // "DEFAULT_STYLE" - Default style.
  671. // "CUSTOM_STYLE" - Custom style.
  672. VisualStyle string `json:"visualStyle,omitempty"`
  673. // ForceSendFields is a list of field names (e.g. "AppInstallationTime")
  674. // to unconditionally include in API requests. By default, fields with
  675. // empty values are omitted from API requests. However, any non-pointer,
  676. // non-interface field appearing in ForceSendFields will be sent to the
  677. // server regardless of whether the field is empty or not. This may be
  678. // used to include empty fields in Patch requests.
  679. ForceSendFields []string `json:"-"`
  680. // NullFields is a list of field names (e.g. "AppInstallationTime") to
  681. // include in API requests with the JSON null value. By default, fields
  682. // with empty values are omitted from API requests. However, any field
  683. // with an empty value appearing in NullFields will be sent to the
  684. // server as null. It is an error if a field in this list has a
  685. // non-empty value. This may be used to include null fields in Patch
  686. // requests.
  687. NullFields []string `json:"-"`
  688. }
  689. func (s *GetIosPostInstallAttributionRequest) MarshalJSON() ([]byte, error) {
  690. type NoMethod GetIosPostInstallAttributionRequest
  691. raw := NoMethod(*s)
  692. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  693. }
  694. // GetIosPostInstallAttributionResponse: Response for iSDK to execute
  695. // strong match flow for post-install attribution.
  696. type GetIosPostInstallAttributionResponse struct {
  697. // AppMinimumVersion: The minimum version for app, specified by dev
  698. // through ?imv= parameter.
  699. // Return to iSDK to allow app to evaluate if current version meets
  700. // this.
  701. AppMinimumVersion string `json:"appMinimumVersion,omitempty"`
  702. // AttributionConfidence: The confidence of the returned attribution.
  703. //
  704. // Possible values:
  705. // "UNKNOWN_ATTRIBUTION_CONFIDENCE" - Unset.
  706. // "WEAK" - Weak confidence, more than one matching link found or link
  707. // suspected to
  708. // be false positive
  709. // "DEFAULT" - Default confidence, match based on fingerprint
  710. // "UNIQUE" - Unique confidence, match based on "unique match link to
  711. // check" or other
  712. // means
  713. AttributionConfidence string `json:"attributionConfidence,omitempty"`
  714. // DeepLink: The deep-link attributed post-install via one of several
  715. // techniques
  716. // (fingerprint, copy unique).
  717. DeepLink string `json:"deepLink,omitempty"`
  718. // ExternalBrowserDestinationLink: User-agent specific custom-scheme
  719. // URIs for iSDK to open. This will be set
  720. // according to the user-agent tha the click was originally made in.
  721. // There is
  722. // no Safari-equivalent custom-scheme open URLs.
  723. // ie: googlechrome://www.example.com
  724. // ie: firefox://open-url?url=http://www.example.com
  725. // ie: opera-http://example.com
  726. ExternalBrowserDestinationLink string `json:"externalBrowserDestinationLink,omitempty"`
  727. // FallbackLink: The link to navigate to update the app if min version
  728. // is not met.
  729. // This is either (in order): 1) fallback link (from ?ifl= parameter,
  730. // if
  731. // specified by developer) or 2) AppStore URL (from ?isi= parameter,
  732. // if
  733. // specified), or 3) the payload link (from required link= parameter).
  734. FallbackLink string `json:"fallbackLink,omitempty"`
  735. // InvitationId: Invitation ID attributed post-install via one of
  736. // several techniques
  737. // (fingerprint, copy unique).
  738. InvitationId string `json:"invitationId,omitempty"`
  739. // IsStrongMatchExecutable: Instruction for iSDK to attemmpt to perform
  740. // strong match. For instance,
  741. // if browser does not support/allow cookie or outside of support
  742. // browsers,
  743. // this will be false.
  744. IsStrongMatchExecutable bool `json:"isStrongMatchExecutable,omitempty"`
  745. // MatchMessage: Describes why match failed, ie: "discarded due to low
  746. // confidence".
  747. // This message will be publicly visible.
  748. MatchMessage string `json:"matchMessage,omitempty"`
  749. // RequestIpVersion: Which IP version the request was made from.
  750. //
  751. // Possible values:
  752. // "UNKNOWN_IP_VERSION" - Unset.
  753. // "IP_V4" - Request made from an IPv4 IP address.
  754. // "IP_V6" - Request made from an IPv6 IP address.
  755. RequestIpVersion string `json:"requestIpVersion,omitempty"`
  756. // RequestedLink: Entire FDL (short or long) attributed post-install via
  757. // one of several
  758. // techniques (fingerprint, copy unique).
  759. RequestedLink string `json:"requestedLink,omitempty"`
  760. // ResolvedLink: The entire FDL, expanded from a short link. It is the
  761. // same as the
  762. // requested_link, if it is long. Parameters from this should not
  763. // be
  764. // used directly (ie: server can default utm_[campaign|medium|source]
  765. // to a value when requested_link lack them, server determine the
  766. // best
  767. // fallback_link when requested_link specifies >1 fallback links).
  768. ResolvedLink string `json:"resolvedLink,omitempty"`
  769. // UtmCampaign: Scion campaign value to be propagated by iSDK to Scion
  770. // at post-install.
  771. UtmCampaign string `json:"utmCampaign,omitempty"`
  772. // UtmMedium: Scion medium value to be propagated by iSDK to Scion at
  773. // post-install.
  774. UtmMedium string `json:"utmMedium,omitempty"`
  775. // UtmSource: Scion source value to be propagated by iSDK to Scion at
  776. // post-install.
  777. UtmSource string `json:"utmSource,omitempty"`
  778. // ServerResponse contains the HTTP response code and headers from the
  779. // server.
  780. googleapi.ServerResponse `json:"-"`
  781. // ForceSendFields is a list of field names (e.g. "AppMinimumVersion")
  782. // to unconditionally include in API requests. By default, fields with
  783. // empty values are omitted from API requests. However, any non-pointer,
  784. // non-interface field appearing in ForceSendFields will be sent to the
  785. // server regardless of whether the field is empty or not. This may be
  786. // used to include empty fields in Patch requests.
  787. ForceSendFields []string `json:"-"`
  788. // NullFields is a list of field names (e.g. "AppMinimumVersion") to
  789. // include in API requests with the JSON null value. By default, fields
  790. // with empty values are omitted from API requests. However, any field
  791. // with an empty value appearing in NullFields will be sent to the
  792. // server as null. It is an error if a field in this list has a
  793. // non-empty value. This may be used to include null fields in Patch
  794. // requests.
  795. NullFields []string `json:"-"`
  796. }
  797. func (s *GetIosPostInstallAttributionResponse) MarshalJSON() ([]byte, error) {
  798. type NoMethod GetIosPostInstallAttributionResponse
  799. raw := NoMethod(*s)
  800. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  801. }
  802. // GooglePlayAnalytics: Parameters for Google Play Campaign
  803. // Measurements.
  804. // [Learn
  805. // more](https://developers.google.com/analytics/devguides/collection/and
  806. // roid/v4/campaigns#campaign-params)
  807. type GooglePlayAnalytics struct {
  808. // Gclid: [AdWords autotagging
  809. // parameter](https://support.google.com/analytics/answer/1033981?hl=en);
  810. //
  811. // used to measure Google AdWords ads. This value is generated
  812. // dynamically
  813. // and should never be modified.
  814. Gclid string `json:"gclid,omitempty"`
  815. // UtmCampaign: Campaign name; used for keyword analysis to identify a
  816. // specific product
  817. // promotion or strategic campaign.
  818. UtmCampaign string `json:"utmCampaign,omitempty"`
  819. // UtmContent: Campaign content; used for A/B testing and
  820. // content-targeted ads to
  821. // differentiate ads or links that point to the same URL.
  822. UtmContent string `json:"utmContent,omitempty"`
  823. // UtmMedium: Campaign medium; used to identify a medium such as email
  824. // or cost-per-click.
  825. UtmMedium string `json:"utmMedium,omitempty"`
  826. // UtmSource: Campaign source; used to identify a search engine,
  827. // newsletter, or other
  828. // source.
  829. UtmSource string `json:"utmSource,omitempty"`
  830. // UtmTerm: Campaign term; used with paid search to supply the keywords
  831. // for ads.
  832. UtmTerm string `json:"utmTerm,omitempty"`
  833. // ForceSendFields is a list of field names (e.g. "Gclid") to
  834. // unconditionally include in API requests. By default, fields with
  835. // empty values are omitted from API requests. However, any non-pointer,
  836. // non-interface field appearing in ForceSendFields will be sent to the
  837. // server regardless of whether the field is empty or not. This may be
  838. // used to include empty fields in Patch requests.
  839. ForceSendFields []string `json:"-"`
  840. // NullFields is a list of field names (e.g. "Gclid") to include in API
  841. // requests with the JSON null value. By default, fields with empty
  842. // values are omitted from API requests. However, any field with an
  843. // empty value appearing in NullFields will be sent to the server as
  844. // null. It is an error if a field in this list has a non-empty value.
  845. // This may be used to include null fields in Patch requests.
  846. NullFields []string `json:"-"`
  847. }
  848. func (s *GooglePlayAnalytics) MarshalJSON() ([]byte, error) {
  849. type NoMethod GooglePlayAnalytics
  850. raw := NoMethod(*s)
  851. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  852. }
  853. // ITunesConnectAnalytics: Parameters for iTunes Connect App Analytics.
  854. type ITunesConnectAnalytics struct {
  855. // At: Affiliate token used to create affiliate-coded links.
  856. At string `json:"at,omitempty"`
  857. // Ct: Campaign text that developers can optionally add to any link in
  858. // order to
  859. // track sales from a specific marketing campaign.
  860. Ct string `json:"ct,omitempty"`
  861. // Mt: iTune media types, including music, podcasts, audiobooks and so
  862. // on.
  863. Mt string `json:"mt,omitempty"`
  864. // Pt: Provider token that enables analytics for Dynamic Links from
  865. // within iTunes
  866. // Connect.
  867. Pt string `json:"pt,omitempty"`
  868. // ForceSendFields is a list of field names (e.g. "At") to
  869. // unconditionally include in API requests. By default, fields with
  870. // empty values are omitted from API requests. However, any non-pointer,
  871. // non-interface field appearing in ForceSendFields will be sent to the
  872. // server regardless of whether the field is empty or not. This may be
  873. // used to include empty fields in Patch requests.
  874. ForceSendFields []string `json:"-"`
  875. // NullFields is a list of field names (e.g. "At") to include in API
  876. // requests with the JSON null value. By default, fields with empty
  877. // values are omitted from API requests. However, any field with an
  878. // empty value appearing in NullFields will be sent to the server as
  879. // null. It is an error if a field in this list has a non-empty value.
  880. // This may be used to include null fields in Patch requests.
  881. NullFields []string `json:"-"`
  882. }
  883. func (s *ITunesConnectAnalytics) MarshalJSON() ([]byte, error) {
  884. type NoMethod ITunesConnectAnalytics
  885. raw := NoMethod(*s)
  886. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  887. }
  888. // IosInfo: iOS related attributes to the Dynamic Link..
  889. type IosInfo struct {
  890. // IosAppStoreId: iOS App Store ID.
  891. IosAppStoreId string `json:"iosAppStoreId,omitempty"`
  892. // IosBundleId: iOS bundle ID of the app.
  893. IosBundleId string `json:"iosBundleId,omitempty"`
  894. // IosCustomScheme: Custom (destination) scheme to use for iOS. By
  895. // default, we’ll use the
  896. // bundle ID as the custom scheme. Developer can override this behavior
  897. // using
  898. // this param.
  899. IosCustomScheme string `json:"iosCustomScheme,omitempty"`
  900. // IosFallbackLink: Link to open on iOS if the app is not installed.
  901. IosFallbackLink string `json:"iosFallbackLink,omitempty"`
  902. // IosIpadBundleId: iPad bundle ID of the app.
  903. IosIpadBundleId string `json:"iosIpadBundleId,omitempty"`
  904. // IosIpadFallbackLink: If specified, this overrides the
  905. // ios_fallback_link value on iPads.
  906. IosIpadFallbackLink string `json:"iosIpadFallbackLink,omitempty"`
  907. // ForceSendFields is a list of field names (e.g. "IosAppStoreId") to
  908. // unconditionally include in API requests. By default, fields with
  909. // empty values are omitted from API requests. However, any non-pointer,
  910. // non-interface field appearing in ForceSendFields will be sent to the
  911. // server regardless of whether the field is empty or not. This may be
  912. // used to include empty fields in Patch requests.
  913. ForceSendFields []string `json:"-"`
  914. // NullFields is a list of field names (e.g. "IosAppStoreId") to include
  915. // in API requests with the JSON null value. By default, fields with
  916. // empty values are omitted from API requests. However, any field with
  917. // an empty value appearing in NullFields will be sent to the server as
  918. // null. It is an error if a field in this list has a non-empty value.
  919. // This may be used to include null fields in Patch requests.
  920. NullFields []string `json:"-"`
  921. }
  922. func (s *IosInfo) MarshalJSON() ([]byte, error) {
  923. type NoMethod IosInfo
  924. raw := NoMethod(*s)
  925. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  926. }
  927. // ManagedShortLink: Managed Short Link.
  928. type ManagedShortLink struct {
  929. // CreationTime: Creation timestamp of the short link.
  930. CreationTime string `json:"creationTime,omitempty"`
  931. // FlaggedAttribute: Attributes that have been flagged about this short
  932. // url.
  933. //
  934. // Possible values:
  935. // "UNSPECIFIED_ATTRIBUTE" - Indicates that no attributes were found
  936. // for this short url.
  937. // "SPAM" - Indicates that short url has been flagged by AbuseIAm team
  938. // as spam.
  939. FlaggedAttribute []string `json:"flaggedAttribute,omitempty"`
  940. // Info: Full Dyamic Link info
  941. Info *DynamicLinkInfo `json:"info,omitempty"`
  942. // Link: Short durable link url, for example,
  943. // "https://sample.app.goo.gl/xyz123".
  944. //
  945. // Required.
  946. Link string `json:"link,omitempty"`
  947. // LinkName: Link name defined by the creator.
  948. //
  949. // Required.
  950. LinkName string `json:"linkName,omitempty"`
  951. // Visibility: Visibility status of link.
  952. //
  953. // Possible values:
  954. // "UNSPECIFIED_VISIBILITY" - Visibility of the link is not specified.
  955. // "UNARCHIVED" - Link created in console and should be shown in
  956. // console.
  957. // "ARCHIVED" - Link created in console and should not be shown in
  958. // console (but can
  959. // be shown in the console again if it is unarchived).
  960. // "NEVER_SHOWN" - Link created outside of console and should never be
  961. // shown in console.
  962. Visibility string `json:"visibility,omitempty"`
  963. // ForceSendFields is a list of field names (e.g. "CreationTime") to
  964. // unconditionally include in API requests. By default, fields with
  965. // empty values are omitted from API requests. However, any non-pointer,
  966. // non-interface field appearing in ForceSendFields will be sent to the
  967. // server regardless of whether the field is empty or not. This may be
  968. // used to include empty fields in Patch requests.
  969. ForceSendFields []string `json:"-"`
  970. // NullFields is a list of field names (e.g. "CreationTime") to include
  971. // in API requests with the JSON null value. By default, fields with
  972. // empty values are omitted from API requests. However, any field with
  973. // an empty value appearing in NullFields will be sent to the server as
  974. // null. It is an error if a field in this list has a non-empty value.
  975. // This may be used to include null fields in Patch requests.
  976. NullFields []string `json:"-"`
  977. }
  978. func (s *ManagedShortLink) MarshalJSON() ([]byte, error) {
  979. type NoMethod ManagedShortLink
  980. raw := NoMethod(*s)
  981. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  982. }
  983. // NavigationInfo: Information of navigation behavior.
  984. type NavigationInfo struct {
  985. // EnableForcedRedirect: If this option is on, FDL click will be forced
  986. // to redirect rather than
  987. // show an interstitial page.
  988. EnableForcedRedirect bool `json:"enableForcedRedirect,omitempty"`
  989. // ForceSendFields is a list of field names (e.g.
  990. // "EnableForcedRedirect") to unconditionally include in API requests.
  991. // By default, fields with empty values are omitted from API requests.
  992. // However, any non-pointer, non-interface field appearing in
  993. // ForceSendFields will be sent to the server regardless of whether the
  994. // field is empty or not. This may be used to include empty fields in
  995. // Patch requests.
  996. ForceSendFields []string `json:"-"`
  997. // NullFields is a list of field names (e.g. "EnableForcedRedirect") to
  998. // include in API requests with the JSON null value. By default, fields
  999. // with empty values are omitted from API requests. However, any field
  1000. // with an empty value appearing in NullFields will be sent to the
  1001. // server as null. It is an error if a field in this list has a
  1002. // non-empty value. This may be used to include null fields in Patch
  1003. // requests.
  1004. NullFields []string `json:"-"`
  1005. }
  1006. func (s *NavigationInfo) MarshalJSON() ([]byte, error) {
  1007. type NoMethod NavigationInfo
  1008. raw := NoMethod(*s)
  1009. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1010. }
  1011. // SocialMetaTagInfo: Parameters for social meta tag params.
  1012. // Used to set meta tag data for link previews on social sites.
  1013. type SocialMetaTagInfo struct {
  1014. // SocialDescription: A short description of the link. Optional.
  1015. SocialDescription string `json:"socialDescription,omitempty"`
  1016. // SocialImageLink: An image url string. Optional.
  1017. SocialImageLink string `json:"socialImageLink,omitempty"`
  1018. // SocialTitle: Title to be displayed. Optional.
  1019. SocialTitle string `json:"socialTitle,omitempty"`
  1020. // ForceSendFields is a list of field names (e.g. "SocialDescription")
  1021. // to unconditionally include in API requests. By default, fields with
  1022. // empty values are omitted from API requests. However, any non-pointer,
  1023. // non-interface field appearing in ForceSendFields will be sent to the
  1024. // server regardless of whether the field is empty or not. This may be
  1025. // used to include empty fields in Patch requests.
  1026. ForceSendFields []string `json:"-"`
  1027. // NullFields is a list of field names (e.g. "SocialDescription") to
  1028. // include in API requests with the JSON null value. By default, fields
  1029. // with empty values are omitted from API requests. However, any field
  1030. // with an empty value appearing in NullFields will be sent to the
  1031. // server as null. It is an error if a field in this list has a
  1032. // non-empty value. This may be used to include null fields in Patch
  1033. // requests.
  1034. NullFields []string `json:"-"`
  1035. }
  1036. func (s *SocialMetaTagInfo) MarshalJSON() ([]byte, error) {
  1037. type NoMethod SocialMetaTagInfo
  1038. raw := NoMethod(*s)
  1039. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1040. }
  1041. // Suffix: Short Dynamic Link suffix.
  1042. type Suffix struct {
  1043. // CustomSuffix: Only applies to Option.CUSTOM.
  1044. CustomSuffix string `json:"customSuffix,omitempty"`
  1045. // Option: Suffix option.
  1046. //
  1047. // Possible values:
  1048. // "OPTION_UNSPECIFIED" - The suffix option is not specified, performs
  1049. // as UNGUESSABLE .
  1050. // "UNGUESSABLE" - Short Dynamic Link suffix is a base62 [0-9A-Za-z]
  1051. // encoded string of
  1052. // a random generated 96 bit random number, which has a length of 17
  1053. // chars.
  1054. // For example, "nlAR8U4SlKRZw1cb2".
  1055. // It prevents other people from guessing and crawling short Dynamic
  1056. // Links
  1057. // that contain personal identifiable information.
  1058. // "SHORT" - Short Dynamic Link suffix is a base62 [0-9A-Za-z] string
  1059. // starting with a
  1060. // length of 4 chars. the length will increase when all the space
  1061. // is
  1062. // occupied.
  1063. // "CUSTOM" - Custom DDL suffix is a client specified string, for
  1064. // example,
  1065. // "buy2get1free".
  1066. // NOTE: custom suffix should only be available to managed short
  1067. // link
  1068. // creation
  1069. Option string `json:"option,omitempty"`
  1070. // ForceSendFields is a list of field names (e.g. "CustomSuffix") to
  1071. // unconditionally include in API requests. By default, fields with
  1072. // empty values are omitted from API requests. However, any non-pointer,
  1073. // non-interface field appearing in ForceSendFields will be sent to the
  1074. // server regardless of whether the field is empty or not. This may be
  1075. // used to include empty fields in Patch requests.
  1076. ForceSendFields []string `json:"-"`
  1077. // NullFields is a list of field names (e.g. "CustomSuffix") to include
  1078. // in API requests with the JSON null value. By default, fields with
  1079. // empty values are omitted from API requests. However, any field with
  1080. // an empty value appearing in NullFields will be sent to the server as
  1081. // null. It is an error if a field in this list has a non-empty value.
  1082. // This may be used to include null fields in Patch requests.
  1083. NullFields []string `json:"-"`
  1084. }
  1085. func (s *Suffix) MarshalJSON() ([]byte, error) {
  1086. type NoMethod Suffix
  1087. raw := NoMethod(*s)
  1088. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1089. }
  1090. // method id "firebasedynamiclinks.managedShortLinks.create":
  1091. type ManagedShortLinksCreateCall struct {
  1092. s *Service
  1093. createmanagedshortlinkrequest *CreateManagedShortLinkRequest
  1094. urlParams_ gensupport.URLParams
  1095. ctx_ context.Context
  1096. header_ http.Header
  1097. }
  1098. // Create: Creates a managed short Dynamic Link given either a valid
  1099. // long Dynamic Link
  1100. // or details such as Dynamic Link domain, Android and iOS app
  1101. // information.
  1102. // The created short Dynamic Link will not expire.
  1103. //
  1104. // This differs from CreateShortDynamicLink in the following ways:
  1105. // - The request will also contain a name for the link (non unique
  1106. // name
  1107. // for the front end).
  1108. // - The response must be authenticated with an auth token (generated
  1109. // with
  1110. // the admin service account).
  1111. // - The link will appear in the FDL list of links in the console
  1112. // front end.
  1113. //
  1114. // The Dynamic Link domain in the request must be owned by
  1115. // requester's
  1116. // Firebase project.
  1117. func (r *ManagedShortLinksService) Create(createmanagedshortlinkrequest *CreateManagedShortLinkRequest) *ManagedShortLinksCreateCall {
  1118. c := &ManagedShortLinksCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1119. c.createmanagedshortlinkrequest = createmanagedshortlinkrequest
  1120. return c
  1121. }
  1122. // Fields allows partial responses to be retrieved. See
  1123. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1124. // for more information.
  1125. func (c *ManagedShortLinksCreateCall) Fields(s ...googleapi.Field) *ManagedShortLinksCreateCall {
  1126. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1127. return c
  1128. }
  1129. // Context sets the context to be used in this call's Do method. Any
  1130. // pending HTTP request will be aborted if the provided context is
  1131. // canceled.
  1132. func (c *ManagedShortLinksCreateCall) Context(ctx context.Context) *ManagedShortLinksCreateCall {
  1133. c.ctx_ = ctx
  1134. return c
  1135. }
  1136. // Header returns an http.Header that can be modified by the caller to
  1137. // add HTTP headers to the request.
  1138. func (c *ManagedShortLinksCreateCall) Header() http.Header {
  1139. if c.header_ == nil {
  1140. c.header_ = make(http.Header)
  1141. }
  1142. return c.header_
  1143. }
  1144. func (c *ManagedShortLinksCreateCall) doRequest(alt string) (*http.Response, error) {
  1145. reqHeaders := make(http.Header)
  1146. for k, v := range c.header_ {
  1147. reqHeaders[k] = v
  1148. }
  1149. reqHeaders.Set("User-Agent", c.s.userAgent())
  1150. var body io.Reader = nil
  1151. body, err := googleapi.WithoutDataWrapper.JSONReader(c.createmanagedshortlinkrequest)
  1152. if err != nil {
  1153. return nil, err
  1154. }
  1155. reqHeaders.Set("Content-Type", "application/json")
  1156. c.urlParams_.Set("alt", alt)
  1157. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/managedShortLinks:create")
  1158. urls += "?" + c.urlParams_.Encode()
  1159. req, _ := http.NewRequest("POST", urls, body)
  1160. req.Header = reqHeaders
  1161. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1162. }
  1163. // Do executes the "firebasedynamiclinks.managedShortLinks.create" call.
  1164. // Exactly one of *CreateManagedShortLinkResponse or error will be
  1165. // non-nil. Any non-2xx status code is an error. Response headers are in
  1166. // either *CreateManagedShortLinkResponse.ServerResponse.Header or (if a
  1167. // response was returned at all) in error.(*googleapi.Error).Header. Use
  1168. // googleapi.IsNotModified to check whether the returned error was
  1169. // because http.StatusNotModified was returned.
  1170. func (c *ManagedShortLinksCreateCall) Do(opts ...googleapi.CallOption) (*CreateManagedShortLinkResponse, error) {
  1171. gensupport.SetOptions(c.urlParams_, opts...)
  1172. res, err := c.doRequest("json")
  1173. if res != nil && res.StatusCode == http.StatusNotModified {
  1174. if res.Body != nil {
  1175. res.Body.Close()
  1176. }
  1177. return nil, &googleapi.Error{
  1178. Code: res.StatusCode,
  1179. Header: res.Header,
  1180. }
  1181. }
  1182. if err != nil {
  1183. return nil, err
  1184. }
  1185. defer googleapi.CloseBody(res)
  1186. if err := googleapi.CheckResponse(res); err != nil {
  1187. return nil, err
  1188. }
  1189. ret := &CreateManagedShortLinkResponse{
  1190. ServerResponse: googleapi.ServerResponse{
  1191. Header: res.Header,
  1192. HTTPStatusCode: res.StatusCode,
  1193. },
  1194. }
  1195. target := &ret
  1196. if err := gensupport.DecodeResponse(target, res); err != nil {
  1197. return nil, err
  1198. }
  1199. return ret, nil
  1200. // {
  1201. // "description": "Creates a managed short Dynamic Link given either a valid long Dynamic Link\nor details such as Dynamic Link domain, Android and iOS app information.\nThe created short Dynamic Link will not expire.\n\nThis differs from CreateShortDynamicLink in the following ways:\n - The request will also contain a name for the link (non unique name\n for the front end).\n - The response must be authenticated with an auth token (generated with\n the admin service account).\n - The link will appear in the FDL list of links in the console front end.\n\nThe Dynamic Link domain in the request must be owned by requester's\nFirebase project.",
  1202. // "flatPath": "v1/managedShortLinks:create",
  1203. // "httpMethod": "POST",
  1204. // "id": "firebasedynamiclinks.managedShortLinks.create",
  1205. // "parameterOrder": [],
  1206. // "parameters": {},
  1207. // "path": "v1/managedShortLinks:create",
  1208. // "request": {
  1209. // "$ref": "CreateManagedShortLinkRequest"
  1210. // },
  1211. // "response": {
  1212. // "$ref": "CreateManagedShortLinkResponse"
  1213. // },
  1214. // "scopes": [
  1215. // "https://www.googleapis.com/auth/firebase"
  1216. // ]
  1217. // }
  1218. }
  1219. // method id "firebasedynamiclinks.shortLinks.create":
  1220. type ShortLinksCreateCall struct {
  1221. s *Service
  1222. createshortdynamiclinkrequest *CreateShortDynamicLinkRequest
  1223. urlParams_ gensupport.URLParams
  1224. ctx_ context.Context
  1225. header_ http.Header
  1226. }
  1227. // Create: Creates a short Dynamic Link given either a valid long
  1228. // Dynamic Link or
  1229. // details such as Dynamic Link domain, Android and iOS app
  1230. // information.
  1231. // The created short Dynamic Link will not expire.
  1232. //
  1233. // Repeated calls with the same long Dynamic Link or Dynamic Link
  1234. // information
  1235. // will produce the same short Dynamic Link.
  1236. //
  1237. // The Dynamic Link domain in the request must be owned by
  1238. // requester's
  1239. // Firebase project.
  1240. func (r *ShortLinksService) Create(createshortdynamiclinkrequest *CreateShortDynamicLinkRequest) *ShortLinksCreateCall {
  1241. c := &ShortLinksCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1242. c.createshortdynamiclinkrequest = createshortdynamiclinkrequest
  1243. return c
  1244. }
  1245. // Fields allows partial responses to be retrieved. See
  1246. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1247. // for more information.
  1248. func (c *ShortLinksCreateCall) Fields(s ...googleapi.Field) *ShortLinksCreateCall {
  1249. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1250. return c
  1251. }
  1252. // Context sets the context to be used in this call's Do method. Any
  1253. // pending HTTP request will be aborted if the provided context is
  1254. // canceled.
  1255. func (c *ShortLinksCreateCall) Context(ctx context.Context) *ShortLinksCreateCall {
  1256. c.ctx_ = ctx
  1257. return c
  1258. }
  1259. // Header returns an http.Header that can be modified by the caller to
  1260. // add HTTP headers to the request.
  1261. func (c *ShortLinksCreateCall) Header() http.Header {
  1262. if c.header_ == nil {
  1263. c.header_ = make(http.Header)
  1264. }
  1265. return c.header_
  1266. }
  1267. func (c *ShortLinksCreateCall) doRequest(alt string) (*http.Response, error) {
  1268. reqHeaders := make(http.Header)
  1269. for k, v := range c.header_ {
  1270. reqHeaders[k] = v
  1271. }
  1272. reqHeaders.Set("User-Agent", c.s.userAgent())
  1273. var body io.Reader = nil
  1274. body, err := googleapi.WithoutDataWrapper.JSONReader(c.createshortdynamiclinkrequest)
  1275. if err != nil {
  1276. return nil, err
  1277. }
  1278. reqHeaders.Set("Content-Type", "application/json")
  1279. c.urlParams_.Set("alt", alt)
  1280. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/shortLinks")
  1281. urls += "?" + c.urlParams_.Encode()
  1282. req, _ := http.NewRequest("POST", urls, body)
  1283. req.Header = reqHeaders
  1284. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1285. }
  1286. // Do executes the "firebasedynamiclinks.shortLinks.create" call.
  1287. // Exactly one of *CreateShortDynamicLinkResponse or error will be
  1288. // non-nil. Any non-2xx status code is an error. Response headers are in
  1289. // either *CreateShortDynamicLinkResponse.ServerResponse.Header or (if a
  1290. // response was returned at all) in error.(*googleapi.Error).Header. Use
  1291. // googleapi.IsNotModified to check whether the returned error was
  1292. // because http.StatusNotModified was returned.
  1293. func (c *ShortLinksCreateCall) Do(opts ...googleapi.CallOption) (*CreateShortDynamicLinkResponse, error) {
  1294. gensupport.SetOptions(c.urlParams_, opts...)
  1295. res, err := c.doRequest("json")
  1296. if res != nil && res.StatusCode == http.StatusNotModified {
  1297. if res.Body != nil {
  1298. res.Body.Close()
  1299. }
  1300. return nil, &googleapi.Error{
  1301. Code: res.StatusCode,
  1302. Header: res.Header,
  1303. }
  1304. }
  1305. if err != nil {
  1306. return nil, err
  1307. }
  1308. defer googleapi.CloseBody(res)
  1309. if err := googleapi.CheckResponse(res); err != nil {
  1310. return nil, err
  1311. }
  1312. ret := &CreateShortDynamicLinkResponse{
  1313. ServerResponse: googleapi.ServerResponse{
  1314. Header: res.Header,
  1315. HTTPStatusCode: res.StatusCode,
  1316. },
  1317. }
  1318. target := &ret
  1319. if err := gensupport.DecodeResponse(target, res); err != nil {
  1320. return nil, err
  1321. }
  1322. return ret, nil
  1323. // {
  1324. // "description": "Creates a short Dynamic Link given either a valid long Dynamic Link or\ndetails such as Dynamic Link domain, Android and iOS app information.\nThe created short Dynamic Link will not expire.\n\nRepeated calls with the same long Dynamic Link or Dynamic Link information\nwill produce the same short Dynamic Link.\n\nThe Dynamic Link domain in the request must be owned by requester's\nFirebase project.",
  1325. // "flatPath": "v1/shortLinks",
  1326. // "httpMethod": "POST",
  1327. // "id": "firebasedynamiclinks.shortLinks.create",
  1328. // "parameterOrder": [],
  1329. // "parameters": {},
  1330. // "path": "v1/shortLinks",
  1331. // "request": {
  1332. // "$ref": "CreateShortDynamicLinkRequest"
  1333. // },
  1334. // "response": {
  1335. // "$ref": "CreateShortDynamicLinkResponse"
  1336. // },
  1337. // "scopes": [
  1338. // "https://www.googleapis.com/auth/firebase"
  1339. // ]
  1340. // }
  1341. }
  1342. // method id "firebasedynamiclinks.getLinkStats":
  1343. type V1GetLinkStatsCall struct {
  1344. s *Service
  1345. dynamicLink string
  1346. urlParams_ gensupport.URLParams
  1347. ifNoneMatch_ string
  1348. ctx_ context.Context
  1349. header_ http.Header
  1350. }
  1351. // GetLinkStats: Fetches analytics stats of a short Dynamic Link for a
  1352. // given
  1353. // duration. Metrics include number of clicks, redirects, installs,
  1354. // app first opens, and app reopens.
  1355. func (r *V1Service) GetLinkStats(dynamicLink string) *V1GetLinkStatsCall {
  1356. c := &V1GetLinkStatsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1357. c.dynamicLink = dynamicLink
  1358. return c
  1359. }
  1360. // DurationDays sets the optional parameter "durationDays": The span of
  1361. // time requested in days.
  1362. func (c *V1GetLinkStatsCall) DurationDays(durationDays int64) *V1GetLinkStatsCall {
  1363. c.urlParams_.Set("durationDays", fmt.Sprint(durationDays))
  1364. return c
  1365. }
  1366. // Fields allows partial responses to be retrieved. See
  1367. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1368. // for more information.
  1369. func (c *V1GetLinkStatsCall) Fields(s ...googleapi.Field) *V1GetLinkStatsCall {
  1370. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1371. return c
  1372. }
  1373. // IfNoneMatch sets the optional parameter which makes the operation
  1374. // fail if the object's ETag matches the given value. This is useful for
  1375. // getting updates only after the object has changed since the last
  1376. // request. Use googleapi.IsNotModified to check whether the response
  1377. // error from Do is the result of In-None-Match.
  1378. func (c *V1GetLinkStatsCall) IfNoneMatch(entityTag string) *V1GetLinkStatsCall {
  1379. c.ifNoneMatch_ = entityTag
  1380. return c
  1381. }
  1382. // Context sets the context to be used in this call's Do method. Any
  1383. // pending HTTP request will be aborted if the provided context is
  1384. // canceled.
  1385. func (c *V1GetLinkStatsCall) Context(ctx context.Context) *V1GetLinkStatsCall {
  1386. c.ctx_ = ctx
  1387. return c
  1388. }
  1389. // Header returns an http.Header that can be modified by the caller to
  1390. // add HTTP headers to the request.
  1391. func (c *V1GetLinkStatsCall) Header() http.Header {
  1392. if c.header_ == nil {
  1393. c.header_ = make(http.Header)
  1394. }
  1395. return c.header_
  1396. }
  1397. func (c *V1GetLinkStatsCall) doRequest(alt string) (*http.Response, error) {
  1398. reqHeaders := make(http.Header)
  1399. for k, v := range c.header_ {
  1400. reqHeaders[k] = v
  1401. }
  1402. reqHeaders.Set("User-Agent", c.s.userAgent())
  1403. if c.ifNoneMatch_ != "" {
  1404. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1405. }
  1406. var body io.Reader = nil
  1407. c.urlParams_.Set("alt", alt)
  1408. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{dynamicLink}/linkStats")
  1409. urls += "?" + c.urlParams_.Encode()
  1410. req, _ := http.NewRequest("GET", urls, body)
  1411. req.Header = reqHeaders
  1412. googleapi.Expand(req.URL, map[string]string{
  1413. "dynamicLink": c.dynamicLink,
  1414. })
  1415. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1416. }
  1417. // Do executes the "firebasedynamiclinks.getLinkStats" call.
  1418. // Exactly one of *DynamicLinkStats or error will be non-nil. Any
  1419. // non-2xx status code is an error. Response headers are in either
  1420. // *DynamicLinkStats.ServerResponse.Header or (if a response was
  1421. // returned at all) in error.(*googleapi.Error).Header. Use
  1422. // googleapi.IsNotModified to check whether the returned error was
  1423. // because http.StatusNotModified was returned.
  1424. func (c *V1GetLinkStatsCall) Do(opts ...googleapi.CallOption) (*DynamicLinkStats, error) {
  1425. gensupport.SetOptions(c.urlParams_, opts...)
  1426. res, err := c.doRequest("json")
  1427. if res != nil && res.StatusCode == http.StatusNotModified {
  1428. if res.Body != nil {
  1429. res.Body.Close()
  1430. }
  1431. return nil, &googleapi.Error{
  1432. Code: res.StatusCode,
  1433. Header: res.Header,
  1434. }
  1435. }
  1436. if err != nil {
  1437. return nil, err
  1438. }
  1439. defer googleapi.CloseBody(res)
  1440. if err := googleapi.CheckResponse(res); err != nil {
  1441. return nil, err
  1442. }
  1443. ret := &DynamicLinkStats{
  1444. ServerResponse: googleapi.ServerResponse{
  1445. Header: res.Header,
  1446. HTTPStatusCode: res.StatusCode,
  1447. },
  1448. }
  1449. target := &ret
  1450. if err := gensupport.DecodeResponse(target, res); err != nil {
  1451. return nil, err
  1452. }
  1453. return ret, nil
  1454. // {
  1455. // "description": "Fetches analytics stats of a short Dynamic Link for a given\nduration. Metrics include number of clicks, redirects, installs,\napp first opens, and app reopens.",
  1456. // "flatPath": "v1/{dynamicLink}/linkStats",
  1457. // "httpMethod": "GET",
  1458. // "id": "firebasedynamiclinks.getLinkStats",
  1459. // "parameterOrder": [
  1460. // "dynamicLink"
  1461. // ],
  1462. // "parameters": {
  1463. // "durationDays": {
  1464. // "description": "The span of time requested in days.",
  1465. // "format": "int64",
  1466. // "location": "query",
  1467. // "type": "string"
  1468. // },
  1469. // "dynamicLink": {
  1470. // "description": "Dynamic Link URL. e.g. https://abcd.app.goo.gl/wxyz",
  1471. // "location": "path",
  1472. // "required": true,
  1473. // "type": "string"
  1474. // }
  1475. // },
  1476. // "path": "v1/{dynamicLink}/linkStats",
  1477. // "response": {
  1478. // "$ref": "DynamicLinkStats"
  1479. // },
  1480. // "scopes": [
  1481. // "https://www.googleapis.com/auth/firebase"
  1482. // ]
  1483. // }
  1484. }
  1485. // method id "firebasedynamiclinks.installAttribution":
  1486. type V1InstallAttributionCall struct {
  1487. s *Service
  1488. getiospostinstallattributionrequest *GetIosPostInstallAttributionRequest
  1489. urlParams_ gensupport.URLParams
  1490. ctx_ context.Context
  1491. header_ http.Header
  1492. }
  1493. // InstallAttribution: Get iOS strong/weak-match info for post-install
  1494. // attribution.
  1495. func (r *V1Service) InstallAttribution(getiospostinstallattributionrequest *GetIosPostInstallAttributionRequest) *V1InstallAttributionCall {
  1496. c := &V1InstallAttributionCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1497. c.getiospostinstallattributionrequest = getiospostinstallattributionrequest
  1498. return c
  1499. }
  1500. // Fields allows partial responses to be retrieved. See
  1501. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1502. // for more information.
  1503. func (c *V1InstallAttributionCall) Fields(s ...googleapi.Field) *V1InstallAttributionCall {
  1504. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1505. return c
  1506. }
  1507. // Context sets the context to be used in this call's Do method. Any
  1508. // pending HTTP request will be aborted if the provided context is
  1509. // canceled.
  1510. func (c *V1InstallAttributionCall) Context(ctx context.Context) *V1InstallAttributionCall {
  1511. c.ctx_ = ctx
  1512. return c
  1513. }
  1514. // Header returns an http.Header that can be modified by the caller to
  1515. // add HTTP headers to the request.
  1516. func (c *V1InstallAttributionCall) Header() http.Header {
  1517. if c.header_ == nil {
  1518. c.header_ = make(http.Header)
  1519. }
  1520. return c.header_
  1521. }
  1522. func (c *V1InstallAttributionCall) doRequest(alt string) (*http.Response, error) {
  1523. reqHeaders := make(http.Header)
  1524. for k, v := range c.header_ {
  1525. reqHeaders[k] = v
  1526. }
  1527. reqHeaders.Set("User-Agent", c.s.userAgent())
  1528. var body io.Reader = nil
  1529. body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiospostinstallattributionrequest)
  1530. if err != nil {
  1531. return nil, err
  1532. }
  1533. reqHeaders.Set("Content-Type", "application/json")
  1534. c.urlParams_.Set("alt", alt)
  1535. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/installAttribution")
  1536. urls += "?" + c.urlParams_.Encode()
  1537. req, _ := http.NewRequest("POST", urls, body)
  1538. req.Header = reqHeaders
  1539. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1540. }
  1541. // Do executes the "firebasedynamiclinks.installAttribution" call.
  1542. // Exactly one of *GetIosPostInstallAttributionResponse or error will be
  1543. // non-nil. Any non-2xx status code is an error. Response headers are in
  1544. // either *GetIosPostInstallAttributionResponse.ServerResponse.Header or
  1545. // (if a response was returned at all) in
  1546. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1547. // whether the returned error was because http.StatusNotModified was
  1548. // returned.
  1549. func (c *V1InstallAttributionCall) Do(opts ...googleapi.CallOption) (*GetIosPostInstallAttributionResponse, error) {
  1550. gensupport.SetOptions(c.urlParams_, opts...)
  1551. res, err := c.doRequest("json")
  1552. if res != nil && res.StatusCode == http.StatusNotModified {
  1553. if res.Body != nil {
  1554. res.Body.Close()
  1555. }
  1556. return nil, &googleapi.Error{
  1557. Code: res.StatusCode,
  1558. Header: res.Header,
  1559. }
  1560. }
  1561. if err != nil {
  1562. return nil, err
  1563. }
  1564. defer googleapi.CloseBody(res)
  1565. if err := googleapi.CheckResponse(res); err != nil {
  1566. return nil, err
  1567. }
  1568. ret := &GetIosPostInstallAttributionResponse{
  1569. ServerResponse: googleapi.ServerResponse{
  1570. Header: res.Header,
  1571. HTTPStatusCode: res.StatusCode,
  1572. },
  1573. }
  1574. target := &ret
  1575. if err := gensupport.DecodeResponse(target, res); err != nil {
  1576. return nil, err
  1577. }
  1578. return ret, nil
  1579. // {
  1580. // "description": "Get iOS strong/weak-match info for post-install attribution.",
  1581. // "flatPath": "v1/installAttribution",
  1582. // "httpMethod": "POST",
  1583. // "id": "firebasedynamiclinks.installAttribution",
  1584. // "parameterOrder": [],
  1585. // "parameters": {},
  1586. // "path": "v1/installAttribution",
  1587. // "request": {
  1588. // "$ref": "GetIosPostInstallAttributionRequest"
  1589. // },
  1590. // "response": {
  1591. // "$ref": "GetIosPostInstallAttributionResponse"
  1592. // },
  1593. // "scopes": [
  1594. // "https://www.googleapis.com/auth/firebase"
  1595. // ]
  1596. // }
  1597. }