export type SasPortalFrequencyRange = {lowFrequencyMhz?: number | undefined, highFrequencyMhz?: number | undefined}; export type SasPortalChannelWithScore = {score?: number | undefined, frequencyRange?: SasPortalFrequencyRange | undefined}; export type SasPortalNrqzValidation = {cpiId?: string | undefined, caseId?: string | undefined, latitude?: number | undefined, longitude?: number | undefined, state?: ('STATE_UNSPECIFIED' | 'DRAFT' | 'FINAL') | undefined}; export type SasPortalDeviceMetadata = {interferenceCoordinationGroup?: string | undefined, antennaModel?: string | undefined, nrqzValidation?: SasPortalNrqzValidation | undefined, nrqzValidated?: boolean | undefined, commonChannelGroup?: string | undefined}; export type SasPortalInstallationParams = {antennaBeamwidth?: number | undefined, antennaModel?: string | undefined, indoorDeployment?: boolean | undefined, antennaAzimuth?: number | undefined, horizontalAccuracy?: number | undefined, height?: number | undefined, latitude?: number | undefined, eirpCapability?: number | undefined, verticalAccuracy?: number | undefined, heightType?: ('HEIGHT_TYPE_UNSPECIFIED' | 'HEIGHT_TYPE_AGL' | 'HEIGHT_TYPE_AMSL') | undefined, antennaDowntilt?: number | undefined, longitude?: number | undefined, cpeCbsdIndication?: boolean | undefined, antennaGain?: number | undefined}; export type SasPortalDeviceAirInterface = {radioTechnology?: ('RADIO_TECHNOLOGY_UNSPECIFIED' | 'E_UTRA' | 'CAMBIUM_NETWORKS' | 'FOUR_G_BBW_SAA_1' | 'NR' | 'DOODLE_CBRS' | 'CW' | 'REDLINE' | 'TARANA_WIRELESS' | 'FAROS') | undefined, supportedSpec?: string | undefined}; export type SasPortalDeviceModel = {hardwareVersion?: string | undefined, softwareVersion?: string | undefined, name?: string | undefined, vendor?: string | undefined, firmwareVersion?: string | undefined}; export type SasPortalDeviceConfig = {category?: ('DEVICE_CATEGORY_UNSPECIFIED' | 'DEVICE_CATEGORY_A' | 'DEVICE_CATEGORY_B') | undefined, measurementCapabilities?: (Array<'MEASUREMENT_CAPABILITY_UNSPECIFIED' | 'MEASUREMENT_CAPABILITY_RECEIVED_POWER_WITH_GRANT' | 'MEASUREMENT_CAPABILITY_RECEIVED_POWER_WITHOUT_GRANT'>) | undefined, state?: ('DEVICE_CONFIG_STATE_UNSPECIFIED' | 'DRAFT' | 'FINAL') | undefined, callSign?: string | undefined, installationParams?: SasPortalInstallationParams | undefined, updateTime?: unknown | undefined, isSigned?: boolean | undefined, airInterface?: SasPortalDeviceAirInterface | undefined, model?: SasPortalDeviceModel | undefined, userId?: string | undefined}; export type SasPortalDpaMoveList = {frequencyRange?: SasPortalFrequencyRange | undefined, dpaId?: string | undefined}; export type SasPortalDeviceGrant = {moveList?: Array | undefined, expireTime?: unknown | undefined, lastHeartbeatTransmitExpireTime?: unknown | undefined, state?: ('GRANT_STATE_UNSPECIFIED' | 'GRANT_STATE_GRANTED' | 'GRANT_STATE_TERMINATED' | 'GRANT_STATE_SUSPENDED' | 'GRANT_STATE_AUTHORIZED' | 'GRANT_STATE_EXPIRED') | undefined, frequencyRange?: SasPortalFrequencyRange | undefined, suspensionReason?: Array | undefined, channelType?: ('CHANNEL_TYPE_UNSPECIFIED' | 'CHANNEL_TYPE_GAA' | 'CHANNEL_TYPE_PAL') | undefined, maxEirp?: number | undefined, grantId?: string | undefined}; export type SasPortalDevice = {fccId?: string | undefined, currentChannels?: Array | undefined, displayName?: string | undefined, deviceMetadata?: SasPortalDeviceMetadata | undefined, preloadedConfig?: SasPortalDeviceConfig | undefined, grantRangeAllowlists?: Array | undefined, state?: ('DEVICE_STATE_UNSPECIFIED' | 'RESERVED' | 'REGISTERED' | 'DEREGISTERED') | undefined, serialNumber?: string | undefined, grants?: Array | undefined, name?: string | undefined, activeConfig?: SasPortalDeviceConfig | undefined}; export type PatchApiV1alpha1NameArgs = {name: string, updateMask?: string | undefined, body: SasPortalDevice}; export type PatchApiV1alpha1NameOptions = {baseUrl?: string | undefined, Oauth2?: string | undefined, Oauth2c?: string | undefined, fetch?: typeof fetch | undefined}; /** * Updates a device. * * PATCH /v1alpha1/{+name} * * Also accepts auth: Oauth2 + Oauth2c */ export const patchApiV1alpha1Name = async (args: PatchApiV1alpha1NameArgs, options?: PatchApiV1alpha1NameOptions) => { const {baseUrl = "https://prod-tt-sasportal.googleapis.com", fetch: fetchFn = fetch, Oauth2, Oauth2c} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "*/*") if (args.updateMask != null) query.append("updateMask", String(args.updateMask)) if (Oauth2 !== undefined) headers.set('authorization', `Bearer ${Oauth2}`) if (Oauth2c !== undefined) headers.set('authorization', `Bearer ${Oauth2c}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1alpha1/${encodeURIComponent(String(args['+name']))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PATCH", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return res.blob() };