import {
OAuth2Client,
JWT,
Compute,
UserRefreshClient,
BaseExternalAccountClient,
GaxiosPromise,
GoogleConfigurable,
createAPIRequest,
MethodOptions,
StreamMethodOptions,
GlobalOptions,
GoogleAuth,
BodyResponseCallback,
APIRequestContext,
} from 'googleapis-common';
import {Readable} from 'stream';
export namespace homegraph_v1 {
export interface Options extends GlobalOptions {
version: 'v1';
}
interface StandardParameters {
auth?:
| string
| OAuth2Client
| JWT
| Compute
| UserRefreshClient
| BaseExternalAccountClient
| GoogleAuth;
'$.xgafv'?: string;
access_token?: string;
alt?: string;
callback?: string;
fields?: string;
key?: string;
oauth_token?: string;
prettyPrint?: boolean;
quotaUser?: string;
uploadType?: string;
upload_protocol?: string;
}
export class Homegraph {
context: APIRequestContext;
agentUsers: Resource$Agentusers;
devices: Resource$Devices;
constructor(options: GlobalOptions, google?: GoogleConfigurable) {
this.context = {
_options: options || {},
google,
};
this.agentUsers = new Resource$Agentusers(this.context);
this.devices = new Resource$Devices(this.context);
}
}
export interface Schema$AgentDeviceId {
id?: string | null;
}
export interface Schema$AgentOtherDeviceId {
agentId?: string | null;
deviceId?: string | null;
}
export interface Schema$Device {
attributes?: {[key: string]: any} | null;
customData?: {[key: string]: any} | null;
deviceInfo?: Schema$DeviceInfo;
id?: string | null;
name?: Schema$DeviceNames;
notificationSupportedByAgent?: boolean | null;
otherDeviceIds?: Schema$AgentOtherDeviceId[];
roomHint?: string | null;
structureHint?: string | null;
traits?: string[] | null;
type?: string | null;
willReportState?: boolean | null;
}
export interface Schema$DeviceInfo {
hwVersion?: string | null;
manufacturer?: string | null;
model?: string | null;
swVersion?: string | null;
}
export interface Schema$DeviceNames {
defaultNames?: string[] | null;
name?: string | null;
nicknames?: string[] | null;
}
export interface Schema$Empty {}
export interface Schema$QueryRequest {
agentUserId?: string | null;
inputs?: Schema$QueryRequestInput[];
requestId?: string | null;
}
export interface Schema$QueryRequestInput {
payload?: Schema$QueryRequestPayload;
}
export interface Schema$QueryRequestPayload {
devices?: Schema$AgentDeviceId[];
}
export interface Schema$QueryResponse {
payload?: Schema$QueryResponsePayload;
requestId?: string | null;
}
export interface Schema$QueryResponsePayload {
devices?: {[key: string]: {[key: string]: any}} | null;
}
export interface Schema$ReportStateAndNotificationDevice {
notifications?: {[key: string]: any} | null;
states?: {[key: string]: any} | null;
}
export interface Schema$ReportStateAndNotificationRequest {
agentUserId?: string | null;
eventId?: string | null;
followUpToken?: string | null;
payload?: Schema$StateAndNotificationPayload;
requestId?: string | null;
}
export interface Schema$ReportStateAndNotificationResponse {
requestId?: string | null;
}
export interface Schema$RequestSyncDevicesRequest {
agentUserId?: string | null;
async?: boolean | null;
}
export interface Schema$RequestSyncDevicesResponse {}
export interface Schema$StateAndNotificationPayload {
devices?: Schema$ReportStateAndNotificationDevice;
}
export interface Schema$SyncRequest {
agentUserId?: string | null;
requestId?: string | null;
}
export interface Schema$SyncResponse {
payload?: Schema$SyncResponsePayload;
requestId?: string | null;
}
export interface Schema$SyncResponsePayload {
agentUserId?: string | null;
devices?: Schema$Device[];
}
export class Resource$Agentusers {
context: APIRequestContext;
constructor(context: APIRequestContext) {
this.context = context;
}
delete(
params: Params$Resource$Agentusers$Delete,
options: StreamMethodOptions
): GaxiosPromise<Readable>;
delete(
params?: Params$Resource$Agentusers$Delete,
options?: MethodOptions
): GaxiosPromise<Schema$Empty>;
delete(
params: Params$Resource$Agentusers$Delete,
options: StreamMethodOptions | BodyResponseCallback<Readable>,
callback: BodyResponseCallback<Readable>
): void;
delete(
params: Params$Resource$Agentusers$Delete,
options: MethodOptions | BodyResponseCallback<Schema$Empty>,
callback: BodyResponseCallback<Schema$Empty>
): void;
delete(
params: Params$Resource$Agentusers$Delete,
callback: BodyResponseCallback<Schema$Empty>
): void;
delete(callback: BodyResponseCallback<Schema$Empty>): void;
delete(
paramsOrCallback?:
| Params$Resource$Agentusers$Delete
| 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$Agentusers$Delete;
let options = (optionsOrCallback || {}) as MethodOptions;
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params = {} as Params$Resource$Agentusers$Delete;
options = {};
}
if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}
const rootUrl = options.rootUrl || 'https://homegraph.googleapis.com/';
const parameters = {
options: Object.assign(
{
url: (rootUrl + '/v1/{+agentUserId}').replace(/([^:]\/)\/+/g, '$1'),
method: 'DELETE',
},
options
),
params,
requiredParams: ['agentUserId'],
pathParams: ['agentUserId'],
context: this.context,
};
if (callback) {
createAPIRequest<Schema$Empty>(
parameters,
callback as BodyResponseCallback<unknown>
);
} else {
return createAPIRequest<Schema$Empty>(parameters);
}
}
}
export interface Params$Resource$Agentusers$Delete
extends StandardParameters {
agentUserId?: string;
requestId?: string;
}
export class Resource$Devices {
context: APIRequestContext;
constructor(context: APIRequestContext) {
this.context = context;
}
query(
params: Params$Resource$Devices$Query,
options: StreamMethodOptions
): GaxiosPromise<Readable>;
query(
params?: Params$Resource$Devices$Query,
options?: MethodOptions
): GaxiosPromise<Schema$QueryResponse>;
query(
params: Params$Resource$Devices$Query,
options: StreamMethodOptions | BodyResponseCallback<Readable>,
callback: BodyResponseCallback<Readable>
): void;
query(
params: Params$Resource$Devices$Query,
options: MethodOptions | BodyResponseCallback<Schema$QueryResponse>,
callback: BodyResponseCallback<Schema$QueryResponse>
): void;
query(
params: Params$Resource$Devices$Query,
callback: BodyResponseCallback<Schema$QueryResponse>
): void;
query(callback: BodyResponseCallback<Schema$QueryResponse>): void;
query(
paramsOrCallback?:
| Params$Resource$Devices$Query
| BodyResponseCallback<Schema$QueryResponse>
| BodyResponseCallback<Readable>,
optionsOrCallback?:
| MethodOptions
| StreamMethodOptions
| BodyResponseCallback<Schema$QueryResponse>
| BodyResponseCallback<Readable>,
callback?:
| BodyResponseCallback<Schema$QueryResponse>
| BodyResponseCallback<Readable>
): void | GaxiosPromise<Schema$QueryResponse> | GaxiosPromise<Readable> {
let params = (paramsOrCallback || {}) as Params$Resource$Devices$Query;
let options = (optionsOrCallback || {}) as MethodOptions;
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params = {} as Params$Resource$Devices$Query;
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:query').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST',
},
options
),
params,
requiredParams: [],
pathParams: [],
context: this.context,
};
if (callback) {
createAPIRequest<Schema$QueryResponse>(
parameters,
callback as BodyResponseCallback<unknown>
);
} else {
return createAPIRequest<Schema$QueryResponse>(parameters);
}
}
reportStateAndNotification(
params: Params$Resource$Devices$Reportstateandnotification,
options: StreamMethodOptions
): GaxiosPromise<Readable>;
reportStateAndNotification(
params?: Params$Resource$Devices$Reportstateandnotification,
options?: MethodOptions
): GaxiosPromise<Schema$ReportStateAndNotificationResponse>;
reportStateAndNotification(
params: Params$Resource$Devices$Reportstateandnotification,
options: StreamMethodOptions | BodyResponseCallback<Readable>,
callback: BodyResponseCallback<Readable>
): void;
reportStateAndNotification(
params: Params$Resource$Devices$Reportstateandnotification,
options:
| MethodOptions
| BodyResponseCallback<Schema$ReportStateAndNotificationResponse>,
callback: BodyResponseCallback<Schema$ReportStateAndNotificationResponse>
): void;
reportStateAndNotification(
params: Params$Resource$Devices$Reportstateandnotification,
callback: BodyResponseCallback<Schema$ReportStateAndNotificationResponse>
): void;
reportStateAndNotification(
callback: BodyResponseCallback<Schema$ReportStateAndNotificationResponse>
): void;
reportStateAndNotification(
paramsOrCallback?:
| Params$Resource$Devices$Reportstateandnotification
| BodyResponseCallback<Schema$ReportStateAndNotificationResponse>
| BodyResponseCallback<Readable>,
optionsOrCallback?:
| MethodOptions
| StreamMethodOptions
| BodyResponseCallback<Schema$ReportStateAndNotificationResponse>
| BodyResponseCallback<Readable>,
callback?:
| BodyResponseCallback<Schema$ReportStateAndNotificationResponse>
| BodyResponseCallback<Readable>
):
| void
| GaxiosPromise<Schema$ReportStateAndNotificationResponse>
| GaxiosPromise<Readable> {
let params = (paramsOrCallback ||
{}) as Params$Resource$Devices$Reportstateandnotification;
let options = (optionsOrCallback || {}) as MethodOptions;
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params = {} as Params$Resource$Devices$Reportstateandnotification;
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:reportStateAndNotification').replace(
/([^:]\/)\/+/g,
'$1'
),
method: 'POST',
},
options
),
params,
requiredParams: [],
pathParams: [],
context: this.context,
};
if (callback) {
createAPIRequest<Schema$ReportStateAndNotificationResponse>(
parameters,
callback as BodyResponseCallback<unknown>
);
} else {
return createAPIRequest<Schema$ReportStateAndNotificationResponse>(
parameters
);
}
}
requestSync(
params: Params$Resource$Devices$Requestsync,
options: StreamMethodOptions
): GaxiosPromise<Readable>;
requestSync(
params?: Params$Resource$Devices$Requestsync,
options?: MethodOptions
): GaxiosPromise<Schema$RequestSyncDevicesResponse>;
requestSync(
params: Params$Resource$Devices$Requestsync,
options: StreamMethodOptions | BodyResponseCallback<Readable>,
callback: BodyResponseCallback<Readable>
): void;
requestSync(
params: Params$Resource$Devices$Requestsync,
options:
| MethodOptions
| BodyResponseCallback<Schema$RequestSyncDevicesResponse>,
callback: BodyResponseCallback<Schema$RequestSyncDevicesResponse>
): void;
requestSync(
params: Params$Resource$Devices$Requestsync,
callback: BodyResponseCallback<Schema$RequestSyncDevicesResponse>
): void;
requestSync(
callback: BodyResponseCallback<Schema$RequestSyncDevicesResponse>
): void;
requestSync(
paramsOrCallback?:
| Params$Resource$Devices$Requestsync
| BodyResponseCallback<Schema$RequestSyncDevicesResponse>
| BodyResponseCallback<Readable>,
optionsOrCallback?:
| MethodOptions
| StreamMethodOptions
| BodyResponseCallback<Schema$RequestSyncDevicesResponse>
| BodyResponseCallback<Readable>,
callback?:
| BodyResponseCallback<Schema$RequestSyncDevicesResponse>
| BodyResponseCallback<Readable>
):
| void
| GaxiosPromise<Schema$RequestSyncDevicesResponse>
| GaxiosPromise<Readable> {
let params = (paramsOrCallback ||
{}) as Params$Resource$Devices$Requestsync;
let options = (optionsOrCallback || {}) as MethodOptions;
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params = {} as Params$Resource$Devices$Requestsync;
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:requestSync').replace(
/([^:]\/)\/+/g,
'$1'
),
method: 'POST',
},
options
),
params,
requiredParams: [],
pathParams: [],
context: this.context,
};
if (callback) {
createAPIRequest<Schema$RequestSyncDevicesResponse>(
parameters,
callback as BodyResponseCallback<unknown>
);
} else {
return createAPIRequest<Schema$RequestSyncDevicesResponse>(parameters);
}
}
sync(
params: Params$Resource$Devices$Sync,
options: StreamMethodOptions
): GaxiosPromise<Readable>;
sync(
params?: Params$Resource$Devices$Sync,
options?: MethodOptions
): GaxiosPromise<Schema$SyncResponse>;
sync(
params: Params$Resource$Devices$Sync,
options: StreamMethodOptions | BodyResponseCallback<Readable>,
callback: BodyResponseCallback<Readable>
): void;
sync(
params: Params$Resource$Devices$Sync,
options: MethodOptions | BodyResponseCallback<Schema$SyncResponse>,
callback: BodyResponseCallback<Schema$SyncResponse>
): void;
sync(
params: Params$Resource$Devices$Sync,
callback: BodyResponseCallback<Schema$SyncResponse>
): void;
sync(callback: BodyResponseCallback<Schema$SyncResponse>): void;
sync(
paramsOrCallback?:
| Params$Resource$Devices$Sync
| BodyResponseCallback<Schema$SyncResponse>
| BodyResponseCallback<Readable>,
optionsOrCallback?:
| MethodOptions
| StreamMethodOptions
| BodyResponseCallback<Schema$SyncResponse>
| BodyResponseCallback<Readable>,
callback?:
| BodyResponseCallback<Schema$SyncResponse>
| BodyResponseCallback<Readable>
): void | GaxiosPromise<Schema$SyncResponse> | GaxiosPromise<Readable> {
let params = (paramsOrCallback || {}) as Params$Resource$Devices$Sync;
let options = (optionsOrCallback || {}) as MethodOptions;
if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params = {} as Params$Resource$Devices$Sync;
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:sync').replace(/([^:]\/)\/+/g, '$1'),
method: 'POST',
},
options
),
params,
requiredParams: [],
pathParams: [],
context: this.context,
};
if (callback) {
createAPIRequest<Schema$SyncResponse>(
parameters,
callback as BodyResponseCallback<unknown>
);
} else {
return createAPIRequest<Schema$SyncResponse>(parameters);
}
}
}
export interface Params$Resource$Devices$Query extends StandardParameters {
requestBody?: Schema$QueryRequest;
}
export interface Params$Resource$Devices$Reportstateandnotification
extends StandardParameters {
requestBody?: Schema$ReportStateAndNotificationRequest;
}
export interface Params$Resource$Devices$Requestsync
extends StandardParameters {
requestBody?: Schema$RequestSyncDevicesRequest;
}
export interface Params$Resource$Devices$Sync extends StandardParameters {
requestBody?: Schema$SyncRequest;
}
}