Skip to content

Commit

Permalink
feat(homegraph)!: update the API
Browse files Browse the repository at this point in the history
BREAKING CHANGE: This release has breaking changes.

#### homegraph:v1

The following keys were deleted:
- resources.devices.methods.requestLink.description
- resources.devices.methods.requestLink.flatPath
- resources.devices.methods.requestLink.httpMethod
- resources.devices.methods.requestLink.id
- resources.devices.methods.requestLink.parameterOrder
- resources.devices.methods.requestLink.path
- resources.devices.methods.requestLink.request.$ref
- resources.devices.methods.requestLink.response.$ref
- resources.devices.methods.requestLink.scopes
- schemas.RequestLinkRequest.description
- schemas.RequestLinkRequest.id
- schemas.RequestLinkRequest.properties.payload.$ref
- schemas.RequestLinkRequest.properties.payload.description
- schemas.RequestLinkRequest.properties.requestId.description
- schemas.RequestLinkRequest.properties.requestId.type
- schemas.RequestLinkRequest.type
- schemas.RequestLinkRequestPayload.description
- schemas.RequestLinkRequestPayload.id
- schemas.RequestLinkRequestPayload.properties.detectionTime.description
- schemas.RequestLinkRequestPayload.properties.detectionTime.format
- schemas.RequestLinkRequestPayload.properties.detectionTime.type
- schemas.RequestLinkRequestPayload.properties.potentialCastDeviceIds.description
- schemas.RequestLinkRequestPayload.properties.potentialCastDeviceIds.items.type
- schemas.RequestLinkRequestPayload.properties.potentialCastDeviceIds.type
- schemas.RequestLinkRequestPayload.type

The following keys were changed:
- schemas.ReportStateAndNotificationRequest.properties.followUpToken.description
  • Loading branch information
yoshi-automation authored and sofisl committed Apr 5, 2021
1 parent f8efd27 commit 203da3f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 221 deletions.
56 changes: 2 additions & 54 deletions discovery/homegraph-v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -177,24 +177,6 @@
"https://www.googleapis.com/auth/homegraph"
]
},
"requestLink": {
"description": "Sends an account linking suggestion to users associated with any potential Cast devices detected by third-party devices. This request must be authorized using service account credentials from your Actions console project.",
"flatPath": "v1/devices:requestLink",
"httpMethod": "POST",
"id": "homegraph.devices.requestLink",
"parameterOrder": [],
"parameters": {},
"path": "v1/devices:requestLink",
"request": {
"$ref": "RequestLinkRequest"
},
"response": {
"$ref": "Empty"
},
"scopes": [
"https://www.googleapis.com/auth/homegraph"
]
},
"requestSync": {
"description": "Requests Google to send an `action.devices.SYNC` [intent](https://developers.google.com/assistant/smarthome/reference/intent/sync) to your smart home Action to update device metadata for the given user. The third-party user's identity is passed via the `agent_user_id` (see RequestSyncDevicesRequest). This request must be authorized using service account credentials from your Actions console project.",
"flatPath": "v1/devices:requestSync",
Expand Down Expand Up @@ -234,7 +216,7 @@
}
}
},
"revision": "20210310",
"revision": "20210326",
"rootUrl": "https://homegraph.googleapis.com/",
"schemas": {
"AgentDeviceId": {
Expand Down Expand Up @@ -520,7 +502,7 @@
"type": "string"
},
"followUpToken": {
"description": "Token to maintain state in the follow up notification response. Deprecated. See the [notifications guide](https://developers.google.com/assistant/smarthome/develop/notifications) for details on implementing follow up notifications.",
"description": "Deprecated.",
"type": "string"
},
"payload": {
Expand All @@ -545,40 +527,6 @@
},
"type": "object"
},
"RequestLinkRequest": {
"description": "Request type for the [`RequestLink`](#google.home.graph.v1.HomeGraphApiService.RequestLink) call.",
"id": "RequestLinkRequest",
"properties": {
"payload": {
"$ref": "RequestLinkRequestPayload",
"description": "Required. ID(s) and detection time of potential Cast devices."
},
"requestId": {
"description": "Required. Request ID used for debugging.",
"type": "string"
}
},
"type": "object"
},
"RequestLinkRequestPayload": {
"description": "Payload containing potential devices detected and when they were detected.",
"id": "RequestLinkRequestPayload",
"properties": {
"detectionTime": {
"description": "Required. Time at which devices represented in `potential_cast_device_ids` were detected.",
"format": "google-datetime",
"type": "string"
},
"potentialCastDeviceIds": {
"description": "Required. List of device IDs detected that may potentially be for Cast devices.",
"items": {
"type": "string"
},
"type": "array"
}
},
"type": "object"
},
"RequestSyncDevicesRequest": {
"description": "Request type for the [`RequestSyncDevices`](#google.home.graph.v1.HomeGraphApiService.RequestSyncDevices) call.",
"id": "RequestSyncDevicesRequest",
Expand Down
168 changes: 1 addition & 167 deletions src/apis/homegraph/v1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ export namespace homegraph_v1 {
*/
eventId?: string | null;
/**
* Token to maintain state in the follow up notification response. Deprecated. See the [notifications guide](https://developers.google.com/assistant/smarthome/develop/notifications) for details on implementing follow up notifications.
* Deprecated.
*/
followUpToken?: string | null;
/**
Expand All @@ -361,32 +361,6 @@ export namespace homegraph_v1 {
*/
requestId?: string | null;
}
/**
* Request type for the [`RequestLink`](#google.home.graph.v1.HomeGraphApiService.RequestLink) call.
*/
export interface Schema$RequestLinkRequest {
/**
* Required. ID(s) and detection time of potential Cast devices.
*/
payload?: Schema$RequestLinkRequestPayload;
/**
* Required. Request ID used for debugging.
*/
requestId?: string | null;
}
/**
* Payload containing potential devices detected and when they were detected.
*/
export interface Schema$RequestLinkRequestPayload {
/**
* Required. Time at which devices represented in `potential_cast_device_ids` were detected.
*/
detectionTime?: string | null;
/**
* Required. List of device IDs detected that may potentially be for Cast devices.
*/
potentialCastDeviceIds?: string[] | null;
}
/**
* Request type for the [`RequestSyncDevices`](#google.home.graph.v1.HomeGraphApiService.RequestSyncDevices) call.
*/
Expand Down Expand Up @@ -884,139 +858,6 @@ export namespace homegraph_v1 {
}
}

/**
* Sends an account linking suggestion to users associated with any potential Cast devices detected by third-party devices. This request must be authorized using service account credentials from your Actions console project.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/homegraph.googleapis.com
* // - Login into gcloud by running:
* // `$ gcloud auth application-default login`
* // - Install the npm module by running:
* // `$ npm install googleapis`
*
* const {google} = require('googleapis');
* const homegraph = google.homegraph('v1');
*
* async function main() {
* const auth = new google.auth.GoogleAuth({
* // Scopes can be specified either as an array or as a single, space-delimited string.
* scopes: ['https://www.googleapis.com/auth/homegraph'],
* });
*
* // Acquire an auth client, and bind it to all future calls
* const authClient = await auth.getClient();
* google.options({auth: authClient});
*
* // Do the magic
* const res = await homegraph.devices.requestLink({
* // Request body metadata
* requestBody: {
* // request body parameters
* // {
* // "payload": {},
* // "requestId": "my_requestId"
* // }
* },
* });
* console.log(res.data);
*
* // Example response
* // {}
* }
*
* main().catch(e => {
* console.error(e);
* throw e;
* });
*
* ```
*
* @param params - Parameters for request
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
* @param callback - Optional callback that handles the response.
* @returns A promise if used with async/await, or void if used with a callback.
*/
requestLink(
params: Params$Resource$Devices$Requestlink,
options: StreamMethodOptions
): GaxiosPromise<Readable>;
requestLink(
params?: Params$Resource$Devices$Requestlink,
options?: MethodOptions
): GaxiosPromise<Schema$Empty>;
requestLink(
params: Params$Resource$Devices$Requestlink,
options: StreamMethodOptions | BodyResponseCallback<Readable>,
callback: BodyResponseCallback<Readable>
): void;
requestLink(
params: Params$Resource$Devices$Requestlink,
options: MethodOptions | BodyResponseCallback<Schema$Empty>,
callback: BodyResponseCallback<Schema$Empty>
): void;
requestLink(
params: Params$Resource$Devices$Requestlink,
callback: BodyResponseCallback<Schema$Empty>
): void;
requestLink(callback: BodyResponseCallback<Schema$Empty>): void;
requestLink(
paramsOrCallback?:
| Params$Resource$Devices$Requestlink
| BodyResponseCallback<Schema$Empty>
| BodyResponseCallback<Readable>,
optionsOrCallback?:
| MethodOptions
| StreamMethodOptions
| BodyResponseCallback<Schema$Empty>
| BodyResponseCallback<Readable>,
callback?:
| BodyResponseCallback<Schema$Empty>
| BodyResponseCallback<Readable>
): void | GaxiosPromise<Schema$Empty> | GaxiosPromise<Readable> {
let params = (paramsOrCallback ||
{}) as Params$Resource$Devices$Requestlink;
let options = (optionsOrCallback || {}) as MethodOptions;

if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params = {} as Params$Resource$Devices$Requestlink;
options = {};
}

if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}

const rootUrl = options.rootUrl || 'https://homegraph.googleapis.com/';
const parameters = {
options: Object.assign(
{
url: (rootUrl + '/v1/devices:requestLink').replace(
/([^:]\/)\/+/g,
'$1'
),
method: 'POST',
},
options
),
params,
requiredParams: [],
pathParams: [],
context: this.context,
};
if (callback) {
createAPIRequest<Schema$Empty>(
parameters,
callback as BodyResponseCallback<unknown>
);
} else {
return createAPIRequest<Schema$Empty>(parameters);
}
}

/**
* Requests Google to send an `action.devices.SYNC` [intent](https://developers.google.com/assistant/smarthome/reference/intent/sync) to your smart home Action to update device metadata for the given user. The third-party user's identity is passed via the `agent_user_id` (see RequestSyncDevicesRequest). This request must be authorized using service account credentials from your Actions console project.
* @example
Expand Down Expand Up @@ -1303,13 +1144,6 @@ export namespace homegraph_v1 {
*/
requestBody?: Schema$ReportStateAndNotificationRequest;
}
export interface Params$Resource$Devices$Requestlink
extends StandardParameters {
/**
* Request body metadata
*/
requestBody?: Schema$RequestLinkRequest;
}
export interface Params$Resource$Devices$Requestsync
extends StandardParameters {
/**
Expand Down

0 comments on commit 203da3f

Please sign in to comment.