Skip to content

Commit

Permalink
feat(webfonts)!: update the API
Browse files Browse the repository at this point in the history
BREAKING CHANGE: This release has breaking changes.
#### webfonts:v1
The following keys were deleted:
- etag
- parameters.userIp.description
- parameters.userIp.location
- parameters.userIp.type
- resources.webfonts.methods.list.parameters.sort.enumDescriptions
- schemas.Webfont.properties.files.additionalProperties.description
- schemas.Webfont.properties.kind.default
- schemas.Webfont.properties.lastModified.format
- schemas.WebfontList.properties.kind.default

The following keys were added:
- canonicalName
- mtlsRootUrl
- parameters.$.xgafv.description
- parameters.$.xgafv.enum
- parameters.$.xgafv.enumDescriptions
- parameters.$.xgafv.location
- parameters.$.xgafv.type
- parameters.access_token.description
- parameters.access_token.location
- parameters.access_token.type
- parameters.callback.description
- parameters.callback.location
- parameters.callback.type
- parameters.uploadType.description
- parameters.uploadType.location
- parameters.uploadType.type
- parameters.upload_protocol.description
- parameters.upload_protocol.location
- parameters.upload_protocol.type
- resources.webfonts.methods.list.flatPath
- resources.webfonts.methods.list.parameterOrder
- schemas.Webfont.description
- schemas.WebfontList.description

The following keys were changed:
- baseUrl
- description
- icons.x16
- icons.x32
- parameters.alt.description
- parameters.alt.enum
- parameters.alt.enumDescriptions
- parameters.quotaUser.description
- resources.webfonts.methods.list.description
- resources.webfonts.methods.list.parameters.sort.description
- resources.webfonts.methods.list.parameters.sort.enum
- resources.webfonts.methods.list.path
- schemas.Webfont.properties.files.description
- title
  • Loading branch information
yoshi-automation authored and JustinBeckwith committed Jul 10, 2020
1 parent d100bc6 commit 1cb38af
Show file tree
Hide file tree
Showing 2 changed files with 96 additions and 50 deletions.
97 changes: 62 additions & 35 deletions discovery/webfonts-v1.json
@@ -1,33 +1,61 @@
{
"basePath": "/webfonts/v1/",
"baseUrl": "https://www.googleapis.com/webfonts/v1/",
"basePath": "",
"baseUrl": "https://www.googleapis.com/",
"batchPath": "batch/webfonts/v1",
"description": "Accesses the metadata for all families served by Google Fonts, providing a list of families currently available (including available styles and a list of supported script subsets).",
"canonicalName": "Webfonts",
"description": "The Google Web Fonts Developer API lets you retrieve information about web fonts served\n by Google.",
"discoveryVersion": "v1",
"documentationLink": "https://developers.google.com/fonts/docs/developer_api",
"etag": "\"u9GIe6H63LSGq-9_t39K2Zx_EAc/5_fiJZHCPuxNkgUtCVK8tszhsbo\"",
"icons": {
"x16": "https://www.google.com/images/icons/feature/font_api-16.png",
"x32": "https://www.google.com/images/icons/feature/font_api-32.gif"
"x16": "http://www.google.com/images/icons/product/search-16.gif",
"x32": "http://www.google.com/images/icons/product/search-32.gif"
},
"id": "webfonts:v1",
"kind": "discovery#restDescription",
"mtlsRootUrl": "https://www.mtls.googleapis.com/",
"name": "webfonts",
"ownerDomain": "google.com",
"ownerName": "Google",
"parameters": {
"$.xgafv": {
"description": "V1 error format.",
"enum": [
"1",
"2"
],
"enumDescriptions": [
"v1 error format",
"v2 error format"
],
"location": "query",
"type": "string"
},
"access_token": {
"description": "OAuth access token.",
"location": "query",
"type": "string"
},
"alt": {
"default": "json",
"description": "Data format for the response.",
"description": "Data format for response.",
"enum": [
"json"
"json",
"media",
"proto"
],
"enumDescriptions": [
"Responses with Content-Type of application/json"
"Responses with Content-Type of application/json",
"Media download with context-dependent Content-Type",
"Responses with Content-Type of application/x-protobuf"
],
"location": "query",
"type": "string"
},
"callback": {
"description": "JSONP",
"location": "query",
"type": "string"
},
"fields": {
"description": "Selector specifying which fields to include in a partial response.",
"location": "query",
Expand All @@ -50,12 +78,17 @@
"type": "boolean"
},
"quotaUser": {
"description": "An opaque string that represents a user for quota purposes. Must not exceed 40 characters.",
"description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.",
"location": "query",
"type": "string"
},
"userIp": {
"description": "Deprecated. Please use quotaUser instead.",
"uploadType": {
"description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").",
"location": "query",
"type": "string"
},
"upload_protocol": {
"description": "Upload protocol for media (e.g. \"raw\", \"multipart\").",
"location": "query",
"type": "string"
}
Expand All @@ -65,42 +98,39 @@
"webfonts": {
"methods": {
"list": {
"description": "Retrieves the list of fonts currently served by the Google Fonts Developer API",
"description": "Retrieves the list of fonts currently served by the Google Fonts Developer\nAPI.",
"flatPath": "v1/webfonts",
"httpMethod": "GET",
"id": "webfonts.webfonts.list",
"parameterOrder": [],
"parameters": {
"sort": {
"description": "Enables sorting of the list",
"description": "Enables sorting of the list.",
"enum": [
"alpha",
"date",
"popularity",
"style",
"trending"
],
"enumDescriptions": [
"Sort alphabetically",
"Sort by date added",
"Sort by popularity",
"Sort by number of styles",
"Sort by trending"
"SORT_UNDEFINED",
"ALPHA",
"DATE",
"POPULARITY",
"STYLE",
"TRENDING"
],
"location": "query",
"type": "string"
}
},
"path": "webfonts",
"path": "v1/webfonts",
"response": {
"$ref": "WebfontList"
}
}
}
}
},
"revision": "20200302",
"revision": "20200706",
"rootUrl": "https://www.googleapis.com/",
"schemas": {
"Webfont": {
"description": "Metadata describing a family of fonts.",
"id": "Webfont",
"properties": {
"category": {
Expand All @@ -113,20 +143,17 @@
},
"files": {
"additionalProperties": {
"description": "The font file URL (value) for an specific variant (key).",
"type": "string"
},
"description": "The font files (with all supported scripts) for each one of the available variants, as a key : value map.",
"description": "The font files (with all supported scripts) for each one of the available\nvariants, as a key : value map.",
"type": "object"
},
"kind": {
"default": "webfonts#webfont",
"description": "This kind represents a webfont object in the webfonts service.",
"type": "string"
},
"lastModified": {
"description": "The date (format \"yyyy-MM-dd\") the font was modified for the last time.",
"format": "date",
"type": "string"
},
"subsets": {
Expand All @@ -151,6 +178,7 @@
"type": "object"
},
"WebfontList": {
"description": "Response containing the list of fonts currently served by the\nGoogle Fonts API.",
"id": "WebfontList",
"properties": {
"items": {
Expand All @@ -161,15 +189,14 @@
"type": "array"
},
"kind": {
"default": "webfonts#webfontList",
"description": "This kind represents a list of webfont objects in the webfonts service.",
"type": "string"
}
},
"type": "object"
}
},
"servicePath": "webfonts/v1/",
"title": "Google Fonts Developer API",
"servicePath": "",
"title": "Web Fonts Developer API",
"version": "v1"
}
49 changes: 34 additions & 15 deletions src/apis/webfonts/v1.ts
Expand Up @@ -53,9 +53,21 @@ export namespace webfonts_v1 {
| GoogleAuth;

/**
* Data format for the response.
* V1 error format.
*/
'$.xgafv'?: string;
/**
* OAuth access token.
*/
access_token?: string;
/**
* Data format for response.
*/
alt?: string;
/**
* JSONP
*/
callback?: string;
/**
* Selector specifying which fields to include in a partial response.
*/
Expand All @@ -73,19 +85,23 @@ export namespace webfonts_v1 {
*/
prettyPrint?: boolean;
/**
* An opaque string that represents a user for quota purposes. Must not exceed 40 characters.
* Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
*/
quotaUser?: string;
/**
* Deprecated. Please use quotaUser instead.
* Legacy upload protocol for media (e.g. "media", "multipart").
*/
userIp?: string;
uploadType?: string;
/**
* Upload protocol for media (e.g. "raw", "multipart").
*/
upload_protocol?: string;
}

/**
* Google Fonts Developer API
* Web Fonts Developer API
*
* Accesses the metadata for all families served by Google Fonts, providing a list of families currently available (including available styles and a list of supported script subsets).
* The Google Web Fonts Developer API lets you retrieve information about web fonts served by Google.
*
* @example
* const {google} = require('googleapis');
Expand All @@ -111,6 +127,9 @@ export namespace webfonts_v1 {
}
}

/**
* Metadata describing a family of fonts.
*/
export interface Schema$Webfont {
/**
* The category of the font.
Expand Down Expand Up @@ -145,6 +164,9 @@ export namespace webfonts_v1 {
*/
version?: string | null;
}
/**
* Response containing the list of fonts currently served by the Google Fonts API.
*/
export interface Schema$WebfontList {
/**
* The list of fonts currently served by the Google Fonts API.
Expand All @@ -164,7 +186,7 @@ export namespace webfonts_v1 {

/**
* webfonts.webfonts.list
* @desc Retrieves the list of fonts currently served by the Google Fonts Developer API
* @desc Retrieves the list of fonts currently served by the Google Fonts Developer API.
* @example
* // Before running the sample:
* // - Enable the API at:
Expand All @@ -189,7 +211,7 @@ export namespace webfonts_v1 {
*
* // Do the magic
* const res = await webfonts.webfonts.list({
* // Enables sorting of the list
* // Enables sorting of the list.
* sort: 'placeholder-value',
* });
* console.log(res.data);
Expand All @@ -209,8 +231,8 @@ export namespace webfonts_v1 {
* @alias webfonts.webfonts.list
* @memberOf! ()
*
* @param {object=} params Parameters for request
* @param {string=} params.sort Enables sorting of the list
* @param {object} params Parameters for request
* @param {string=} params.sort Enables sorting of the list.
* @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`.
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
Expand Down Expand Up @@ -270,10 +292,7 @@ export namespace webfonts_v1 {
const parameters = {
options: Object.assign(
{
url: (rootUrl + '/webfonts/v1/webfonts').replace(
/([^:]\/)\/+/g,
'$1'
),
url: (rootUrl + '/v1/webfonts').replace(/([^:]\/)\/+/g, '$1'),
method: 'GET',
},
options
Expand All @@ -296,7 +315,7 @@ export namespace webfonts_v1 {

export interface Params$Resource$Webfonts$List extends StandardParameters {
/**
* Enables sorting of the list
* Enables sorting of the list.
*/
sort?: string;
}
Expand Down

0 comments on commit 1cb38af

Please sign in to comment.