Bye bye openapi (#1081)

* add DateTime sans mgo

* change all uses of strfmt.DateTime to common.DateTime, remove test strfmt usage

* remove api tests, system-test dep on api test

multiple reasons to remove the api tests:

* awkward dependency with fn_go meant generating bindings on a branched fn to
vendor those to test new stuff. this is at a minimum not at all intuitive,
worth it, nor a fun way to spend the finite amount of time we have to live.
* api tests only tested a subset of functionality that the server/ api tests
already test, and we risk having tests where one tests some thing and the
other doesn't. let's not. we have too many test suites as it is, and these
pretty much only test that we updated the fn_go bindings, which is actually a
hassle as noted above and the cli will pretty quickly figure out anyway.
* fn_go relies on openapi, which relies on mgo, which is deprecated and we'd
like to remove as a dependency. openapi is a _huge_ dep built in a NIH
fashion, that cannot simply remove the mgo dep as users may be using it.
we've now stolen their date time and otherwise killed usage of it in fn core,
for fn_go it still exists but that's less of a problem.

* update deps

removals:

* easyjson
* mgo
* go-openapi
* mapstructure
* fn_go
* purell
* go-validator

also, had to lock docker. we shouldn't use docker on master anyway, they
strongly advise against that. had no luck with latest version rev, so i locked
it to what we were using before. until next time.

the rest is just playing dep roulette, those end up removing a ton tho

* fix exec test to work

* account for john le cache
This commit is contained in:
Reed Allman
2018-06-21 11:09:16 -07:00
committed by GitHub
parent aa5d7169f4
commit 51ff7caeb2
2635 changed files with 440440 additions and 402994 deletions

View File

@@ -9,7 +9,7 @@
}
},
"basePath": "",
"baseUrl": "https://firebasedynamiclinks-ipv6.googleapis.com/",
"baseUrl": "https://firebasedynamiclinks.googleapis.com/",
"batchPath": "batch",
"canonicalName": "Firebase Dynamic Links",
"description": "Programmatically creates and manages Firebase Dynamic Links.",
@@ -114,6 +114,28 @@
},
"protocol": "rest",
"resources": {
"managedShortLinks": {
"methods": {
"create": {
"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.",
"flatPath": "v1/managedShortLinks:create",
"httpMethod": "POST",
"id": "firebasedynamiclinks.managedShortLinks.create",
"parameterOrder": [],
"parameters": {},
"path": "v1/managedShortLinks:create",
"request": {
"$ref": "CreateManagedShortLinkRequest"
},
"response": {
"$ref": "CreateManagedShortLinkResponse"
},
"scopes": [
"https://www.googleapis.com/auth/firebase"
]
}
}
},
"shortLinks": {
"methods": {
"create": {
@@ -189,8 +211,8 @@
}
}
},
"revision": "20180303",
"rootUrl": "https://firebasedynamiclinks-ipv6.googleapis.com/",
"revision": "20180524",
"rootUrl": "https://firebasedynamiclinks.googleapis.com/",
"schemas": {
"AnalyticsInfo": {
"description": "Tracking parameters supported by Dynamic Link.",
@@ -230,6 +252,51 @@
},
"type": "object"
},
"CreateManagedShortLinkRequest": {
"description": "Request to create a managed Short Dynamic Link.",
"id": "CreateManagedShortLinkRequest",
"properties": {
"dynamicLinkInfo": {
"$ref": "DynamicLinkInfo",
"description": "Information about the Dynamic Link to be shortened.\n[Learn more](https://firebase.google.com/docs/reference/dynamic-links/link-shortener)."
},
"longDynamicLink": {
"description": "Full long Dynamic Link URL with desired query parameters specified.\nFor example,\n\"https://sample.app.goo.gl/?link=http://www.google.com\u0026apn=com.sample\",\n[Learn more](https://firebase.google.com/docs/reference/dynamic-links/link-shortener).",
"type": "string"
},
"name": {
"description": "Link name to associate with the link. It's used for marketer to identify\nmanually-created links in the Firebase console\n(https://console.firebase.google.com/).\nLinks must be named to be tracked.",
"type": "string"
},
"suffix": {
"$ref": "Suffix",
"description": "Short Dynamic Link suffix. Optional."
}
},
"type": "object"
},
"CreateManagedShortLinkResponse": {
"description": "Response to create a short Dynamic Link.",
"id": "CreateManagedShortLinkResponse",
"properties": {
"managedShortLink": {
"$ref": "ManagedShortLink",
"description": "Short Dynamic Link value. e.g. https://abcd.app.goo.gl/wxyz"
},
"previewLink": {
"description": "Preview link to show the link flow chart. (debug info.)",
"type": "string"
},
"warning": {
"description": "Information about potential warnings on link creation.",
"items": {
"$ref": "DynamicLinkWarning"
},
"type": "array"
}
},
"type": "object"
},
"CreateShortDynamicLinkRequest": {
"description": "Request to create a short Dynamic Link.",
"id": "CreateShortDynamicLinkRequest",
@@ -254,7 +321,7 @@
"id": "CreateShortDynamicLinkResponse",
"properties": {
"previewLink": {
"description": "Preivew link to show the link flow chart.",
"description": "Preview link to show the link flow chart. (debug info.)",
"type": "string"
},
"shortLink": {
@@ -354,13 +421,15 @@
"DYNAMIC_LINK_PLATFORM_UNSPECIFIED",
"ANDROID",
"IOS",
"DESKTOP"
"DESKTOP",
"OTHER"
],
"enumDescriptions": [
"Unspecified platform.",
"Represents Android platform.\nAll apps and browsers on Android are classfied in this category.",
"Represents iOS platform.\nAll apps and browsers on iOS are classfied in this category.",
"Represents desktop.\nNote: other platforms like Windows, Blackberry, Amazon fall into this\ncategory."
"Represents desktop.",
"Platforms are not categorized as Android/iOS/Destop fall into here."
],
"type": "string"
}
@@ -383,6 +452,10 @@
"$ref": "DesktopInfo",
"description": "Desktop related information. See desktop related parameters in the\n[documentation](https://firebase.google.com/docs/dynamic-links/create-manually)."
},
"domainUriPrefix": {
"description": "E.g. https://maps.app.goo.gl, https://maps.page.link, https://g.co/maps\nMore examples can be found in description of getNormalizedUriPrefix in\nj/c/g/firebase/dynamiclinks/uri/DdlDomain.java",
"type": "string"
},
"dynamicLinkDomain": {
"description": "Dynamic Links domain that the project owns, e.g. abcd.app.goo.gl\n[Learn more](https://firebase.google.com/docs/dynamic-links/android/receive)\non how to set up Dynamic Link domain associated with your Firebase project.\n\nRequired.",
"type": "string"
@@ -611,6 +684,20 @@
"description": "Describes why match failed, ie: \"discarded due to low confidence\".\nThis message will be publicly visible.",
"type": "string"
},
"requestIpVersion": {
"description": "Which IP version the request was made from.",
"enum": [
"UNKNOWN_IP_VERSION",
"IP_V4",
"IP_V6"
],
"enumDescriptions": [
"Unset.",
"Request made from an IPv4 IP address.",
"Request made from an IPv6 IP address."
],
"type": "string"
},
"requestedLink": {
"description": "Entire FDL (short or long) attributed post-install via one of several\ntechniques (fingerprint, copy unique).",
"type": "string"
@@ -719,6 +806,61 @@
},
"type": "object"
},
"ManagedShortLink": {
"description": "Managed Short Link.",
"id": "ManagedShortLink",
"properties": {
"creationTime": {
"description": "Creation timestamp of the short link.",
"format": "google-datetime",
"type": "string"
},
"flaggedAttribute": {
"description": "Attributes that have been flagged about this short url.",
"enumDescriptions": [
"Indicates that no attributes were found for this short url.",
"Indicates that short url has been flagged by AbuseIAm team as spam."
],
"items": {
"enum": [
"UNSPECIFIED_ATTRIBUTE",
"SPAM"
],
"type": "string"
},
"type": "array"
},
"info": {
"$ref": "DynamicLinkInfo",
"description": "Full Dyamic Link info"
},
"link": {
"description": "Short durable link url, for example, \"https://sample.app.goo.gl/xyz123\".\n\nRequired.",
"type": "string"
},
"linkName": {
"description": "Link name defined by the creator.\n\nRequired.",
"type": "string"
},
"visibility": {
"description": "Visibility status of link.",
"enum": [
"UNSPECIFIED_VISIBILITY",
"UNARCHIVED",
"ARCHIVED",
"NEVER_SHOWN"
],
"enumDescriptions": [
"Visibility of the link is not specified.",
"Link created in console and should be shown in console.",
"Link created in console and should not be shown in console (but can\nbe shown in the console again if it is unarchived).",
"Link created outside of console and should never be shown in console."
],
"type": "string"
}
},
"type": "object"
},
"NavigationInfo": {
"description": "Information of navigation behavior.",
"id": "NavigationInfo",
@@ -753,17 +895,23 @@
"description": "Short Dynamic Link suffix.",
"id": "Suffix",
"properties": {
"customSuffix": {
"description": "Only applies to Option.CUSTOM.",
"type": "string"
},
"option": {
"description": "Suffix option.",
"enum": [
"OPTION_UNSPECIFIED",
"UNGUESSABLE",
"SHORT"
"SHORT",
"CUSTOM"
],
"enumDescriptions": [
"The suffix option is not specified, performs as NOT_GUESSABLE .",
"The suffix option is not specified, performs as UNGUESSABLE .",
"Short Dynamic Link suffix is a base62 [0-9A-Za-z] encoded string of\na random generated 96 bit random number, which has a length of 17 chars.\nFor example, \"nlAR8U4SlKRZw1cb2\".\nIt prevents other people from guessing and crawling short Dynamic Links\nthat contain personal identifiable information.",
"Short Dynamic Link suffix is a base62 [0-9A-Za-z] string starting with a\nlength of 4 chars. the length will increase when all the space is\noccupied."
"Short Dynamic Link suffix is a base62 [0-9A-Za-z] string starting with a\nlength of 4 chars. the length will increase when all the space is\noccupied.",
"Custom DDL suffix is a client specified string, for example,\n\"buy2get1free\".\nNOTE: custom suffix should only be available to managed short link\ncreation"
],
"type": "string"
}

View File

@@ -43,7 +43,7 @@ var _ = ctxhttp.Do
const apiId = "firebasedynamiclinks:v1"
const apiName = "firebasedynamiclinks"
const apiVersion = "v1"
const basePath = "https://firebasedynamiclinks-ipv6.googleapis.com/"
const basePath = "https://firebasedynamiclinks.googleapis.com/"
// OAuth2 scopes used by this API.
const (
@@ -56,6 +56,7 @@ func New(client *http.Client) (*Service, error) {
return nil, errors.New("client is nil")
}
s := &Service{client: client, BasePath: basePath}
s.ManagedShortLinks = NewManagedShortLinksService(s)
s.ShortLinks = NewShortLinksService(s)
s.V1 = NewV1Service(s)
return s, nil
@@ -66,6 +67,8 @@ type Service struct {
BasePath string // API endpoint base URL
UserAgent string // optional additional User-Agent fragment
ManagedShortLinks *ManagedShortLinksService
ShortLinks *ShortLinksService
V1 *V1Service
@@ -78,6 +81,15 @@ func (s *Service) userAgent() string {
return googleapi.UserAgent + " " + s.UserAgent
}
func NewManagedShortLinksService(s *Service) *ManagedShortLinksService {
rs := &ManagedShortLinksService{s: s}
return rs
}
type ManagedShortLinksService struct {
s *Service
}
func NewShortLinksService(s *Service) *ShortLinksService {
rs := &ShortLinksService{s: s}
return rs
@@ -170,6 +182,103 @@ func (s *AndroidInfo) MarshalJSON() ([]byte, error) {
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// CreateManagedShortLinkRequest: Request to create a managed Short
// Dynamic Link.
type CreateManagedShortLinkRequest struct {
// DynamicLinkInfo: Information about the Dynamic Link to be
// shortened.
// [Learn
// more](https://firebase.google.com/docs/reference/dynamic-links/link-sh
// ortener).
DynamicLinkInfo *DynamicLinkInfo `json:"dynamicLinkInfo,omitempty"`
// LongDynamicLink: Full long Dynamic Link URL with desired query
// parameters specified.
// For
// example,
// "https://sample.app.goo.gl/?link=http://www.google.com&apn=co
// m.sample",
// [Learn
// more](https://firebase.google.com/docs/reference/dynamic-links/link-sh
// ortener).
LongDynamicLink string `json:"longDynamicLink,omitempty"`
// Name: Link name to associate with the link. It's used for marketer to
// identify
// manually-created links in the Firebase
// console
// (https://console.firebase.google.com/).
// Links must be named to be tracked.
Name string `json:"name,omitempty"`
// Suffix: Short Dynamic Link suffix. Optional.
Suffix *Suffix `json:"suffix,omitempty"`
// ForceSendFields is a list of field names (e.g. "DynamicLinkInfo") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "DynamicLinkInfo") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *CreateManagedShortLinkRequest) MarshalJSON() ([]byte, error) {
type NoMethod CreateManagedShortLinkRequest
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// CreateManagedShortLinkResponse: Response to create a short Dynamic
// Link.
type CreateManagedShortLinkResponse struct {
// ManagedShortLink: Short Dynamic Link value. e.g.
// https://abcd.app.goo.gl/wxyz
ManagedShortLink *ManagedShortLink `json:"managedShortLink,omitempty"`
// PreviewLink: Preview link to show the link flow chart. (debug info.)
PreviewLink string `json:"previewLink,omitempty"`
// Warning: Information about potential warnings on link creation.
Warning []*DynamicLinkWarning `json:"warning,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "ManagedShortLink") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "ManagedShortLink") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *CreateManagedShortLinkResponse) MarshalJSON() ([]byte, error) {
type NoMethod CreateManagedShortLinkResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// CreateShortDynamicLinkRequest: Request to create a short Dynamic
// Link.
type CreateShortDynamicLinkRequest struct {
@@ -221,7 +330,7 @@ func (s *CreateShortDynamicLinkRequest) MarshalJSON() ([]byte, error) {
// CreateShortDynamicLinkResponse: Response to create a short Dynamic
// Link.
type CreateShortDynamicLinkResponse struct {
// PreviewLink: Preivew link to show the link flow chart.
// PreviewLink: Preview link to show the link flow chart. (debug info.)
PreviewLink string `json:"previewLink,omitempty"`
// ShortLink: Short Dynamic Link value. e.g.
@@ -371,9 +480,8 @@ type DynamicLinkEventStat struct {
// "IOS" - Represents iOS platform.
// All apps and browsers on iOS are classfied in this category.
// "DESKTOP" - Represents desktop.
// Note: other platforms like Windows, Blackberry, Amazon fall into
// this
// category.
// "OTHER" - Platforms are not categorized as Android/iOS/Destop fall
// into here.
Platform string `json:"platform,omitempty"`
// ForceSendFields is a list of field names (e.g. "Count") to
@@ -422,6 +530,13 @@ type DynamicLinkInfo struct {
// ate-manually).
DesktopInfo *DesktopInfo `json:"desktopInfo,omitempty"`
// DomainUriPrefix: E.g. https://maps.app.goo.gl,
// https://maps.page.link, https://g.co/maps
// More examples can be found in description of getNormalizedUriPrefix
// in
// j/c/g/firebase/dynamiclinks/uri/DdlDomain.java
DomainUriPrefix string `json:"domainUriPrefix,omitempty"`
// DynamicLinkDomain: Dynamic Links domain that the project owns, e.g.
// abcd.app.goo.gl
// [Learn
@@ -749,6 +864,14 @@ type GetIosPostInstallAttributionResponse struct {
// This message will be publicly visible.
MatchMessage string `json:"matchMessage,omitempty"`
// RequestIpVersion: Which IP version the request was made from.
//
// Possible values:
// "UNKNOWN_IP_VERSION" - Unset.
// "IP_V4" - Request made from an IPv4 IP address.
// "IP_V6" - Request made from an IPv6 IP address.
RequestIpVersion string `json:"requestIpVersion,omitempty"`
// RequestedLink: Entire FDL (short or long) attributed post-install via
// one of several
// techniques (fingerprint, copy unique).
@@ -954,6 +1077,71 @@ func (s *IosInfo) MarshalJSON() ([]byte, error) {
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ManagedShortLink: Managed Short Link.
type ManagedShortLink struct {
// CreationTime: Creation timestamp of the short link.
CreationTime string `json:"creationTime,omitempty"`
// FlaggedAttribute: Attributes that have been flagged about this short
// url.
//
// Possible values:
// "UNSPECIFIED_ATTRIBUTE" - Indicates that no attributes were found
// for this short url.
// "SPAM" - Indicates that short url has been flagged by AbuseIAm team
// as spam.
FlaggedAttribute []string `json:"flaggedAttribute,omitempty"`
// Info: Full Dyamic Link info
Info *DynamicLinkInfo `json:"info,omitempty"`
// Link: Short durable link url, for example,
// "https://sample.app.goo.gl/xyz123".
//
// Required.
Link string `json:"link,omitempty"`
// LinkName: Link name defined by the creator.
//
// Required.
LinkName string `json:"linkName,omitempty"`
// Visibility: Visibility status of link.
//
// Possible values:
// "UNSPECIFIED_VISIBILITY" - Visibility of the link is not specified.
// "UNARCHIVED" - Link created in console and should be shown in
// console.
// "ARCHIVED" - Link created in console and should not be shown in
// console (but can
// be shown in the console again if it is unarchived).
// "NEVER_SHOWN" - Link created outside of console and should never be
// shown in console.
Visibility string `json:"visibility,omitempty"`
// ForceSendFields is a list of field names (e.g. "CreationTime") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "CreationTime") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *ManagedShortLink) MarshalJSON() ([]byte, error) {
type NoMethod ManagedShortLink
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// NavigationInfo: Information of navigation behavior.
type NavigationInfo struct {
// EnableForcedRedirect: If this option is on, FDL click will be forced
@@ -1024,11 +1212,14 @@ func (s *SocialMetaTagInfo) MarshalJSON() ([]byte, error) {
// Suffix: Short Dynamic Link suffix.
type Suffix struct {
// CustomSuffix: Only applies to Option.CUSTOM.
CustomSuffix string `json:"customSuffix,omitempty"`
// Option: Suffix option.
//
// Possible values:
// "OPTION_UNSPECIFIED" - The suffix option is not specified, performs
// as NOT_GUESSABLE .
// as UNGUESSABLE .
// "UNGUESSABLE" - Short Dynamic Link suffix is a base62 [0-9A-Za-z]
// encoded string of
// a random generated 96 bit random number, which has a length of 17
@@ -1042,9 +1233,15 @@ type Suffix struct {
// length of 4 chars. the length will increase when all the space
// is
// occupied.
// "CUSTOM" - Custom DDL suffix is a client specified string, for
// example,
// "buy2get1free".
// NOTE: custom suffix should only be available to managed short
// link
// creation
Option string `json:"option,omitempty"`
// ForceSendFields is a list of field names (e.g. "Option") to
// ForceSendFields is a list of field names (e.g. "CustomSuffix") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
@@ -1052,10 +1249,10 @@ type Suffix struct {
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Option") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// NullFields is a list of field names (e.g. "CustomSuffix") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
@@ -1067,6 +1264,144 @@ func (s *Suffix) MarshalJSON() ([]byte, error) {
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// method id "firebasedynamiclinks.managedShortLinks.create":
type ManagedShortLinksCreateCall struct {
s *Service
createmanagedshortlinkrequest *CreateManagedShortLinkRequest
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// Create: Creates a managed short Dynamic Link given either a valid
// long Dynamic Link
// or details such as Dynamic Link domain, Android and iOS app
// information.
// The created short Dynamic Link will not expire.
//
// This differs from CreateShortDynamicLink in the following ways:
// - The request will also contain a name for the link (non unique
// name
// for the front end).
// - The response must be authenticated with an auth token (generated
// with
// the admin service account).
// - The link will appear in the FDL list of links in the console
// front end.
//
// The Dynamic Link domain in the request must be owned by
// requester's
// Firebase project.
func (r *ManagedShortLinksService) Create(createmanagedshortlinkrequest *CreateManagedShortLinkRequest) *ManagedShortLinksCreateCall {
c := &ManagedShortLinksCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.createmanagedshortlinkrequest = createmanagedshortlinkrequest
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *ManagedShortLinksCreateCall) Fields(s ...googleapi.Field) *ManagedShortLinksCreateCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *ManagedShortLinksCreateCall) Context(ctx context.Context) *ManagedShortLinksCreateCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *ManagedShortLinksCreateCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ManagedShortLinksCreateCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.createmanagedshortlinkrequest)
if err != nil {
return nil, err
}
reqHeaders.Set("Content-Type", "application/json")
c.urlParams_.Set("alt", alt)
urls := googleapi.ResolveRelative(c.s.BasePath, "v1/managedShortLinks:create")
urls += "?" + c.urlParams_.Encode()
req, _ := http.NewRequest("POST", urls, body)
req.Header = reqHeaders
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "firebasedynamiclinks.managedShortLinks.create" call.
// Exactly one of *CreateManagedShortLinkResponse or error will be
// non-nil. Any non-2xx status code is an error. Response headers are in
// either *CreateManagedShortLinkResponse.ServerResponse.Header or (if a
// response was returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was
// because http.StatusNotModified was returned.
func (c *ManagedShortLinksCreateCall) Do(opts ...googleapi.CallOption) (*CreateManagedShortLinkResponse, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &CreateManagedShortLinkResponse{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "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.",
// "flatPath": "v1/managedShortLinks:create",
// "httpMethod": "POST",
// "id": "firebasedynamiclinks.managedShortLinks.create",
// "parameterOrder": [],
// "parameters": {},
// "path": "v1/managedShortLinks:create",
// "request": {
// "$ref": "CreateManagedShortLinkRequest"
// },
// "response": {
// "$ref": "CreateManagedShortLinkResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/firebase"
// ]
// }
}
// method id "firebasedynamiclinks.shortLinks.create":
type ShortLinksCreateCall struct {