Skip to main content
Module

x/aws_api/services/dynamodb/mod.ts

From-scratch Typescript client for accessing AWS APIs
Extremely Popular
Latest
File
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365
// Autogenerated API client for: Amazon DynamoDB
export * from "./structs.ts";import * as Base64 from "https://deno.land/std@0.177.0/encoding/base64.ts";import * as client from "../../client/common.ts";import * as cmnP from "../../encoding/common.ts";import * as jsonP from "../../encoding/json.ts";import type * as s from "./structs.ts";function generateIdemptToken() { return crypto.randomUUID();}function serializeBlob(input: string | Uint8Array | null | undefined) { if (input == null) return input; return Base64.encode(input);}
export class DynamoDB { #client: client.ServiceClient; constructor(apiFactory: client.ApiFactory) { this.#client = apiFactory.buildServiceClient(DynamoDB.ApiMetadata); }
static ApiMetadata: client.ApiMetadata = { "apiVersion": "2012-08-10", "endpointPrefix": "dynamodb", "jsonVersion": "1.0", "protocol": "json", "serviceAbbreviation": "DynamoDB", "serviceFullName": "Amazon DynamoDB", "serviceId": "DynamoDB", "signatureVersion": "v4", "targetPrefix": "DynamoDB_20120810", "uid": "dynamodb-2012-08-10" };
async batchExecuteStatement( params: s.BatchExecuteStatementInput, opts: client.RequestOptions = {}, ): Promise<s.BatchExecuteStatementOutput> { const body: jsonP.JSONObject = { Statements: params["Statements"]?.map(x => fromBatchStatementRequest(x)), ReturnConsumedCapacity: params["ReturnConsumedCapacity"], }; const resp = await this.#client.performRequest({ opts, body, action: "BatchExecuteStatement", }); return jsonP.readObj({ required: {}, optional: { "Responses": [toBatchStatementResponse], "ConsumedCapacity": [toConsumedCapacity], }, }, await resp.json()); }
async batchGetItem( params: s.BatchGetItemInput, opts: client.RequestOptions = {}, ): Promise<s.BatchGetItemOutput> { const body: jsonP.JSONObject = { RequestItems: jsonP.serializeMap(params["RequestItems"], x => fromKeysAndAttributes(x)), ReturnConsumedCapacity: params["ReturnConsumedCapacity"], }; const resp = await this.#client.performRequest({ opts, body, action: "BatchGetItem", }); return jsonP.readObj({ required: {}, optional: { "Responses": x => jsonP.readMap(String, l => Array.isArray(l) ? l.map(y => jsonP.readMap(String, toAttributeValue, y)!) : [], x), "UnprocessedKeys": x => jsonP.readMap(String, toKeysAndAttributes, x), "ConsumedCapacity": [toConsumedCapacity], }, }, await resp.json()); }
async batchWriteItem( params: s.BatchWriteItemInput, opts: client.RequestOptions = {}, ): Promise<s.BatchWriteItemOutput> { const body: jsonP.JSONObject = { RequestItems: jsonP.serializeMap(params["RequestItems"], x => x?.map(fromWriteRequest)), ReturnConsumedCapacity: params["ReturnConsumedCapacity"], ReturnItemCollectionMetrics: params["ReturnItemCollectionMetrics"], }; const resp = await this.#client.performRequest({ opts, body, action: "BatchWriteItem", }); return jsonP.readObj({ required: {}, optional: { "UnprocessedItems": x => jsonP.readMap(String, l => Array.isArray(l) ? l.map(toWriteRequest) : [], x), "ItemCollectionMetrics": x => jsonP.readMap(String, l => Array.isArray(l) ? l.map(toItemCollectionMetrics) : [], x), "ConsumedCapacity": [toConsumedCapacity], }, }, await resp.json()); }
async createBackup( params: s.CreateBackupInput, opts: client.RequestOptions = {}, ): Promise<s.CreateBackupOutput> { const body: jsonP.JSONObject = { TableName: params["TableName"], BackupName: params["BackupName"], }; const resp = await this.#client.performRequest({ opts, body, action: "CreateBackup", }); return jsonP.readObj({ required: {}, optional: { "BackupDetails": toBackupDetails, }, }, await resp.json()); }
async createGlobalTable( params: s.CreateGlobalTableInput, opts: client.RequestOptions = {}, ): Promise<s.CreateGlobalTableOutput> { const body: jsonP.JSONObject = { GlobalTableName: params["GlobalTableName"], ReplicationGroup: params["ReplicationGroup"]?.map(x => fromReplica(x)), }; const resp = await this.#client.performRequest({ opts, body, action: "CreateGlobalTable", }); return jsonP.readObj({ required: {}, optional: { "GlobalTableDescription": toGlobalTableDescription, }, }, await resp.json()); }
async createTable( params: s.CreateTableInput, opts: client.RequestOptions = {}, ): Promise<s.CreateTableOutput> { const body: jsonP.JSONObject = { AttributeDefinitions: params["AttributeDefinitions"]?.map(x => fromAttributeDefinition(x)), TableName: params["TableName"], KeySchema: params["KeySchema"]?.map(x => fromKeySchemaElement(x)), LocalSecondaryIndexes: params["LocalSecondaryIndexes"]?.map(x => fromLocalSecondaryIndex(x)), GlobalSecondaryIndexes: params["GlobalSecondaryIndexes"]?.map(x => fromGlobalSecondaryIndex(x)), BillingMode: params["BillingMode"], ProvisionedThroughput: fromProvisionedThroughput(params["ProvisionedThroughput"]), StreamSpecification: fromStreamSpecification(params["StreamSpecification"]), SSESpecification: fromSSESpecification(params["SSESpecification"]), Tags: params["Tags"]?.map(x => fromTag(x)), TableClass: params["TableClass"], }; const resp = await this.#client.performRequest({ opts, body, action: "CreateTable", }); return jsonP.readObj({ required: {}, optional: { "TableDescription": toTableDescription, }, }, await resp.json()); }
async deleteBackup( params: s.DeleteBackupInput, opts: client.RequestOptions = {}, ): Promise<s.DeleteBackupOutput> { const body: jsonP.JSONObject = { BackupArn: params["BackupArn"], }; const resp = await this.#client.performRequest({ opts, body, action: "DeleteBackup", }); return jsonP.readObj({ required: {}, optional: { "BackupDescription": toBackupDescription, }, }, await resp.json()); }
async deleteItem( params: s.DeleteItemInput, opts: client.RequestOptions = {}, ): Promise<s.DeleteItemOutput> { const body: jsonP.JSONObject = { TableName: params["TableName"], Key: jsonP.serializeMap(params["Key"], x => fromAttributeValue(x)), Expected: jsonP.serializeMap(params["Expected"], x => fromExpectedAttributeValue(x)), ConditionalOperator: params["ConditionalOperator"], ReturnValues: params["ReturnValues"], ReturnConsumedCapacity: params["ReturnConsumedCapacity"], ReturnItemCollectionMetrics: params["ReturnItemCollectionMetrics"], ConditionExpression: params["ConditionExpression"], ExpressionAttributeNames: params["ExpressionAttributeNames"], ExpressionAttributeValues: jsonP.serializeMap(params["ExpressionAttributeValues"], x => fromAttributeValue(x)), }; const resp = await this.#client.performRequest({ opts, body, action: "DeleteItem", }); return jsonP.readObj({ required: {}, optional: { "Attributes": x => jsonP.readMap(String, toAttributeValue, x), "ConsumedCapacity": toConsumedCapacity, "ItemCollectionMetrics": toItemCollectionMetrics, }, }, await resp.json()); }
async deleteTable( params: s.DeleteTableInput, opts: client.RequestOptions = {}, ): Promise<s.DeleteTableOutput> { const body: jsonP.JSONObject = { TableName: params["TableName"], }; const resp = await this.#client.performRequest({ opts, body, action: "DeleteTable", }); return jsonP.readObj({ required: {}, optional: { "TableDescription": toTableDescription, }, }, await resp.json()); }
async describeBackup( params: s.DescribeBackupInput, opts: client.RequestOptions = {}, ): Promise<s.DescribeBackupOutput> { const body: jsonP.JSONObject = { BackupArn: params["BackupArn"], }; const resp = await this.#client.performRequest({ opts, body, action: "DescribeBackup", }); return jsonP.readObj({ required: {}, optional: { "BackupDescription": toBackupDescription, }, }, await resp.json()); }
async describeContinuousBackups( params: s.DescribeContinuousBackupsInput, opts: client.RequestOptions = {}, ): Promise<s.DescribeContinuousBackupsOutput> { const body: jsonP.JSONObject = { TableName: params["TableName"], }; const resp = await this.#client.performRequest({ opts, body, action: "DescribeContinuousBackups", }); return jsonP.readObj({ required: {}, optional: { "ContinuousBackupsDescription": toContinuousBackupsDescription, }, }, await resp.json()); }
async describeContributorInsights( params: s.DescribeContributorInsightsInput, opts: client.RequestOptions = {}, ): Promise<s.DescribeContributorInsightsOutput> { const body: jsonP.JSONObject = { TableName: params["TableName"], IndexName: params["IndexName"], }; const resp = await this.#client.performRequest({ opts, body, action: "DescribeContributorInsights", }); return jsonP.readObj({ required: {}, optional: { "TableName": "s", "IndexName": "s", "ContributorInsightsRuleList": ["s"], "ContributorInsightsStatus": (x: jsonP.JSONValue) => cmnP.readEnum<s.ContributorInsightsStatus>(x), "LastUpdateDateTime": "d", "FailureException": toFailureException, }, }, await resp.json()); }
async describeEndpoints( opts: client.RequestOptions = {}, ): Promise<s.DescribeEndpointsResponse> { const body: jsonP.JSONObject = {}; const resp = await this.#client.performRequest({ opts, body, action: "DescribeEndpoints", }); return jsonP.readObj({ required: { "Endpoints": [toEndpoint], }, optional: {}, }, await resp.json()); }
async describeExport( params: s.DescribeExportInput, opts: client.RequestOptions = {}, ): Promise<s.DescribeExportOutput> { const body: jsonP.JSONObject = { ExportArn: params["ExportArn"], }; const resp = await this.#client.performRequest({ opts, body, action: "DescribeExport", }); return jsonP.readObj({ required: {}, optional: { "ExportDescription": toExportDescription, }, }, await resp.json()); }
async describeGlobalTable( params: s.DescribeGlobalTableInput, opts: client.RequestOptions = {}, ): Promise<s.DescribeGlobalTableOutput> { const body: jsonP.JSONObject = { GlobalTableName: params["GlobalTableName"], }; const resp = await this.#client.performRequest({ opts, body, action: "DescribeGlobalTable", }); return jsonP.readObj({ required: {}, optional: { "GlobalTableDescription": toGlobalTableDescription, }, }, await resp.json()); }
async describeGlobalTableSettings( params: s.DescribeGlobalTableSettingsInput, opts: client.RequestOptions = {}, ): Promise<s.DescribeGlobalTableSettingsOutput> { const body: jsonP.JSONObject = { GlobalTableName: params["GlobalTableName"], }; const resp = await this.#client.performRequest({ opts, body, action: "DescribeGlobalTableSettings", }); return jsonP.readObj({ required: {}, optional: { "GlobalTableName": "s", "ReplicaSettings": [toReplicaSettingsDescription], }, }, await resp.json()); }
async describeKinesisStreamingDestination( params: s.DescribeKinesisStreamingDestinationInput, opts: client.RequestOptions = {}, ): Promise<s.DescribeKinesisStreamingDestinationOutput> { const body: jsonP.JSONObject = { TableName: params["TableName"], }; const resp = await this.#client.performRequest({ opts, body, action: "DescribeKinesisStreamingDestination", }); return jsonP.readObj({ required: {}, optional: { "TableName": "s", "KinesisDataStreamDestinations": [toKinesisDataStreamDestination], }, }, await resp.json()); }
async describeLimits( opts: client.RequestOptions = {}, ): Promise<s.DescribeLimitsOutput> { const body: jsonP.JSONObject = {}; const resp = await this.#client.performRequest({ opts, body, action: "DescribeLimits", }); return jsonP.readObj({ required: {}, optional: { "AccountMaxReadCapacityUnits": "n", "AccountMaxWriteCapacityUnits": "n", "TableMaxReadCapacityUnits": "n", "TableMaxWriteCapacityUnits": "n", }, }, await resp.json()); }
async describeTable( params: s.DescribeTableInput, opts: client.RequestOptions = {}, ): Promise<s.DescribeTableOutput> { const body: jsonP.JSONObject = { TableName: params["TableName"], }; const resp = await this.#client.performRequest({ opts, body, action: "DescribeTable", }); return jsonP.readObj({ required: {}, optional: { "Table": toTableDescription, }, }, await resp.json()); }
async describeTableReplicaAutoScaling( params: s.DescribeTableReplicaAutoScalingInput, opts: client.RequestOptions = {}, ): Promise<s.DescribeTableReplicaAutoScalingOutput> { const body: jsonP.JSONObject = { TableName: params["TableName"], }; const resp = await this.#client.performRequest({ opts, body, action: "DescribeTableReplicaAutoScaling", }); return jsonP.readObj({ required: {}, optional: { "TableAutoScalingDescription": toTableAutoScalingDescription, }, }, await resp.json()); }
async describeTimeToLive( params: s.DescribeTimeToLiveInput, opts: client.RequestOptions = {}, ): Promise<s.DescribeTimeToLiveOutput> { const body: jsonP.JSONObject = { TableName: params["TableName"], }; const resp = await this.#client.performRequest({ opts, body, action: "DescribeTimeToLive", }); return jsonP.readObj({ required: {}, optional: { "TimeToLiveDescription": toTimeToLiveDescription, }, }, await resp.json()); }
async disableKinesisStreamingDestination( params: s.KinesisStreamingDestinationInput, opts: client.RequestOptions = {}, ): Promise<s.KinesisStreamingDestinationOutput> { const body: jsonP.JSONObject = { TableName: params["TableName"], StreamArn: params["StreamArn"], }; const resp = await this.#client.performRequest({ opts, body, action: "DisableKinesisStreamingDestination", }); return jsonP.readObj({ required: {}, optional: { "TableName": "s", "StreamArn": "s", "DestinationStatus": (x: jsonP.JSONValue) => cmnP.readEnum<s.DestinationStatus>(x), }, }, await resp.json()); }
async enableKinesisStreamingDestination( params: s.KinesisStreamingDestinationInput, opts: client.RequestOptions = {}, ): Promise<s.KinesisStreamingDestinationOutput> { const body: jsonP.JSONObject = { TableName: params["TableName"], StreamArn: params["StreamArn"], }; const resp = await this.#client.performRequest({ opts, body, action: "EnableKinesisStreamingDestination", }); return jsonP.readObj({ required: {}, optional: { "TableName": "s", "StreamArn": "s", "DestinationStatus": (x: jsonP.JSONValue) => cmnP.readEnum<s.DestinationStatus>(x), }, }, await resp.json()); }
async executeStatement( params: s.ExecuteStatementInput, opts: client.RequestOptions = {}, ): Promise<s.ExecuteStatementOutput> { const body: jsonP.JSONObject = { Statement: params["Statement"], Parameters: params["Parameters"]?.map(x => fromAttributeValue(x)), ConsistentRead: params["ConsistentRead"], NextToken: params["NextToken"], ReturnConsumedCapacity: params["ReturnConsumedCapacity"], }; const resp = await this.#client.performRequest({ opts, body, action: "ExecuteStatement", }); return jsonP.readObj({ required: {}, optional: { "Items": [x => jsonP.readMap(String, toAttributeValue, x)], "NextToken": "s", "ConsumedCapacity": toConsumedCapacity, }, }, await resp.json()); }
async executeTransaction( params: s.ExecuteTransactionInput, opts: client.RequestOptions = {}, ): Promise<s.ExecuteTransactionOutput> { const body: jsonP.JSONObject = { TransactStatements: params["TransactStatements"]?.map(x => fromParameterizedStatement(x)), ClientRequestToken: params["ClientRequestToken"] ?? generateIdemptToken(), ReturnConsumedCapacity: params["ReturnConsumedCapacity"], }; const resp = await this.#client.performRequest({ opts, body, action: "ExecuteTransaction", }); return jsonP.readObj({ required: {}, optional: { "Responses": [toItemResponse], "ConsumedCapacity": [toConsumedCapacity], }, }, await resp.json()); }
async exportTableToPointInTime( params: s.ExportTableToPointInTimeInput, opts: client.RequestOptions = {}, ): Promise<s.ExportTableToPointInTimeOutput> { const body: jsonP.JSONObject = { TableArn: params["TableArn"], ExportTime: jsonP.serializeDate_unixTimestamp(params["ExportTime"]), ClientToken: params["ClientToken"] ?? generateIdemptToken(), S3Bucket: params["S3Bucket"], S3BucketOwner: params["S3BucketOwner"], S3Prefix: params["S3Prefix"], S3SseAlgorithm: params["S3SseAlgorithm"], S3SseKmsKeyId: params["S3SseKmsKeyId"], ExportFormat: params["ExportFormat"], }; const resp = await this.#client.performRequest({ opts, body, action: "ExportTableToPointInTime", }); return jsonP.readObj({ required: {}, optional: { "ExportDescription": toExportDescription, }, }, await resp.json()); }
async getItem( params: s.GetItemInput, opts: client.RequestOptions = {}, ): Promise<s.GetItemOutput> { const body: jsonP.JSONObject = { TableName: params["TableName"], Key: jsonP.serializeMap(params["Key"], x => fromAttributeValue(x)), AttributesToGet: params["AttributesToGet"], ConsistentRead: params["ConsistentRead"], ReturnConsumedCapacity: params["ReturnConsumedCapacity"], ProjectionExpression: params["ProjectionExpression"], ExpressionAttributeNames: params["ExpressionAttributeNames"], }; const resp = await this.#client.performRequest({ opts, body, action: "GetItem", }); return jsonP.readObj({ required: {}, optional: { "Item": x => jsonP.readMap(String, toAttributeValue, x), "ConsumedCapacity": toConsumedCapacity, }, }, await resp.json()); }
async listBackups( params: s.ListBackupsInput = {}, opts: client.RequestOptions = {}, ): Promise<s.ListBackupsOutput> { const body: jsonP.JSONObject = { TableName: params["TableName"], Limit: params["Limit"], TimeRangeLowerBound: jsonP.serializeDate_unixTimestamp(params["TimeRangeLowerBound"]), TimeRangeUpperBound: jsonP.serializeDate_unixTimestamp(params["TimeRangeUpperBound"]), ExclusiveStartBackupArn: params["ExclusiveStartBackupArn"], BackupType: params["BackupType"], }; const resp = await this.#client.performRequest({ opts, body, action: "ListBackups", }); return jsonP.readObj({ required: {}, optional: { "BackupSummaries": [toBackupSummary], "LastEvaluatedBackupArn": "s", }, }, await resp.json()); }
async listContributorInsights( params: s.ListContributorInsightsInput = {}, opts: client.RequestOptions = {}, ): Promise<s.ListContributorInsightsOutput> { const body: jsonP.JSONObject = { TableName: params["TableName"], NextToken: params["NextToken"], MaxResults: params["MaxResults"], }; const resp = await this.#client.performRequest({ opts, body, action: "ListContributorInsights", }); return jsonP.readObj({ required: {}, optional: { "ContributorInsightsSummaries": [toContributorInsightsSummary], "NextToken": "s", }, }, await resp.json()); }
async listExports( params: s.ListExportsInput = {}, opts: client.RequestOptions = {}, ): Promise<s.ListExportsOutput> { const body: jsonP.JSONObject = { TableArn: params["TableArn"], MaxResults: params["MaxResults"], NextToken: params["NextToken"], }; const resp = await this.#client.performRequest({ opts, body, action: "ListExports", }); return jsonP.readObj({ required: {}, optional: { "ExportSummaries": [toExportSummary], "NextToken": "s", }, }, await resp.json()); }
async listGlobalTables( params: s.ListGlobalTablesInput = {}, opts: client.RequestOptions = {}, ): Promise<s.ListGlobalTablesOutput> { const body: jsonP.JSONObject = { ExclusiveStartGlobalTableName: params["ExclusiveStartGlobalTableName"], Limit: params["Limit"], RegionName: params["RegionName"], }; const resp = await this.#client.performRequest({ opts, body, action: "ListGlobalTables", }); return jsonP.readObj({ required: {}, optional: { "GlobalTables": [toGlobalTable], "LastEvaluatedGlobalTableName": "s", }, }, await resp.json()); }
async listTables( params: s.ListTablesInput = {}, opts: client.RequestOptions = {}, ): Promise<s.ListTablesOutput> { const body: jsonP.JSONObject = { ExclusiveStartTableName: params["ExclusiveStartTableName"], Limit: params["Limit"], }; const resp = await this.#client.performRequest({ opts, body, action: "ListTables", }); return jsonP.readObj({ required: {}, optional: { "TableNames": ["s"], "LastEvaluatedTableName": "s", }, }, await resp.json()); }
async listTagsOfResource( params: s.ListTagsOfResourceInput, opts: client.RequestOptions = {}, ): Promise<s.ListTagsOfResourceOutput> { const body: jsonP.JSONObject = { ResourceArn: params["ResourceArn"], NextToken: params["NextToken"], }; const resp = await this.#client.performRequest({ opts, body, action: "ListTagsOfResource", }); return jsonP.readObj({ required: {}, optional: { "Tags": [toTag], "NextToken": "s", }, }, await resp.json()); }
async putItem( params: s.PutItemInput, opts: client.RequestOptions = {}, ): Promise<s.PutItemOutput> { const body: jsonP.JSONObject = { TableName: params["TableName"], Item: jsonP.serializeMap(params["Item"], x => fromAttributeValue(x)), Expected: jsonP.serializeMap(params["Expected"], x => fromExpectedAttributeValue(x)), ReturnValues: params["ReturnValues"], ReturnConsumedCapacity: params["ReturnConsumedCapacity"], ReturnItemCollectionMetrics: params["ReturnItemCollectionMetrics"], ConditionalOperator: params["ConditionalOperator"], ConditionExpression: params["ConditionExpression"], ExpressionAttributeNames: params["ExpressionAttributeNames"], ExpressionAttributeValues: jsonP.serializeMap(params["ExpressionAttributeValues"], x => fromAttributeValue(x)), }; const resp = await this.#client.performRequest({ opts, body, action: "PutItem", }); return jsonP.readObj({ required: {}, optional: { "Attributes": x => jsonP.readMap(String, toAttributeValue, x), "ConsumedCapacity": toConsumedCapacity, "ItemCollectionMetrics": toItemCollectionMetrics, }, }, await resp.json()); }
async query( params: s.QueryInput, opts: client.RequestOptions = {}, ): Promise<s.QueryOutput> { const body: jsonP.JSONObject = { TableName: params["TableName"], IndexName: params["IndexName"], Select: params["Select"], AttributesToGet: params["AttributesToGet"], Limit: params["Limit"], ConsistentRead: params["ConsistentRead"], KeyConditions: jsonP.serializeMap(params["KeyConditions"], x => fromCondition(x)), QueryFilter: jsonP.serializeMap(params["QueryFilter"], x => fromCondition(x)), ConditionalOperator: params["ConditionalOperator"], ScanIndexForward: params["ScanIndexForward"], ExclusiveStartKey: jsonP.serializeMap(params["ExclusiveStartKey"], x => fromAttributeValue(x)), ReturnConsumedCapacity: params["ReturnConsumedCapacity"], ProjectionExpression: params["ProjectionExpression"], FilterExpression: params["FilterExpression"], KeyConditionExpression: params["KeyConditionExpression"], ExpressionAttributeNames: params["ExpressionAttributeNames"], ExpressionAttributeValues: jsonP.serializeMap(params["ExpressionAttributeValues"], x => fromAttributeValue(x)), }; const resp = await this.#client.performRequest({ opts, body, action: "Query", }); return jsonP.readObj({ required: {}, optional: { "Items": [x => jsonP.readMap(String, toAttributeValue, x)], "Count": "n", "ScannedCount": "n", "LastEvaluatedKey": x => jsonP.readMap(String, toAttributeValue, x), "ConsumedCapacity": toConsumedCapacity, }, }, await resp.json()); }
async restoreTableFromBackup( params: s.RestoreTableFromBackupInput, opts: client.RequestOptions = {}, ): Promise<s.RestoreTableFromBackupOutput> { const body: jsonP.JSONObject = { TargetTableName: params["TargetTableName"], BackupArn: params["BackupArn"], BillingModeOverride: params["BillingModeOverride"], GlobalSecondaryIndexOverride: params["GlobalSecondaryIndexOverride"]?.map(x => fromGlobalSecondaryIndex(x)), LocalSecondaryIndexOverride: params["LocalSecondaryIndexOverride"]?.map(x => fromLocalSecondaryIndex(x)), ProvisionedThroughputOverride: fromProvisionedThroughput(params["ProvisionedThroughputOverride"]), SSESpecificationOverride: fromSSESpecification(params["SSESpecificationOverride"]), }; const resp = await this.#client.performRequest({ opts, body, action: "RestoreTableFromBackup", }); return jsonP.readObj({ required: {}, optional: { "TableDescription": toTableDescription, }, }, await resp.json()); }
async restoreTableToPointInTime( params: s.RestoreTableToPointInTimeInput, opts: client.RequestOptions = {}, ): Promise<s.RestoreTableToPointInTimeOutput> { const body: jsonP.JSONObject = { SourceTableArn: params["SourceTableArn"], SourceTableName: params["SourceTableName"], TargetTableName: params["TargetTableName"], UseLatestRestorableTime: params["UseLatestRestorableTime"], RestoreDateTime: jsonP.serializeDate_unixTimestamp(params["RestoreDateTime"]), BillingModeOverride: params["BillingModeOverride"], GlobalSecondaryIndexOverride: params["GlobalSecondaryIndexOverride"]?.map(x => fromGlobalSecondaryIndex(x)), LocalSecondaryIndexOverride: params["LocalSecondaryIndexOverride"]?.map(x => fromLocalSecondaryIndex(x)), ProvisionedThroughputOverride: fromProvisionedThroughput(params["ProvisionedThroughputOverride"]), SSESpecificationOverride: fromSSESpecification(params["SSESpecificationOverride"]), }; const resp = await this.#client.performRequest({ opts, body, action: "RestoreTableToPointInTime", }); return jsonP.readObj({ required: {}, optional: { "TableDescription": toTableDescription, }, }, await resp.json()); }
async scan( params: s.ScanInput, opts: client.RequestOptions = {}, ): Promise<s.ScanOutput> { const body: jsonP.JSONObject = { TableName: params["TableName"], IndexName: params["IndexName"], AttributesToGet: params["AttributesToGet"], Limit: params["Limit"], Select: params["Select"], ScanFilter: jsonP.serializeMap(params["ScanFilter"], x => fromCondition(x)), ConditionalOperator: params["ConditionalOperator"], ExclusiveStartKey: jsonP.serializeMap(params["ExclusiveStartKey"], x => fromAttributeValue(x)), ReturnConsumedCapacity: params["ReturnConsumedCapacity"], TotalSegments: params["TotalSegments"], Segment: params["Segment"], ProjectionExpression: params["ProjectionExpression"], FilterExpression: params["FilterExpression"], ExpressionAttributeNames: params["ExpressionAttributeNames"], ExpressionAttributeValues: jsonP.serializeMap(params["ExpressionAttributeValues"], x => fromAttributeValue(x)), ConsistentRead: params["ConsistentRead"], }; const resp = await this.#client.performRequest({ opts, body, action: "Scan", }); return jsonP.readObj({ required: {}, optional: { "Items": [x => jsonP.readMap(String, toAttributeValue, x)], "Count": "n", "ScannedCount": "n", "LastEvaluatedKey": x => jsonP.readMap(String, toAttributeValue, x), "ConsumedCapacity": toConsumedCapacity, }, }, await resp.json()); }
async tagResource( params: s.TagResourceInput, opts: client.RequestOptions = {}, ): Promise<void> { const body: jsonP.JSONObject = { ResourceArn: params["ResourceArn"], Tags: params["Tags"]?.map(x => fromTag(x)), }; const resp = await this.#client.performRequest({ opts, body, action: "TagResource", }); await resp.body?.cancel(); }
async transactGetItems( params: s.TransactGetItemsInput, opts: client.RequestOptions = {}, ): Promise<s.TransactGetItemsOutput> { const body: jsonP.JSONObject = { TransactItems: params["TransactItems"]?.map(x => fromTransactGetItem(x)), ReturnConsumedCapacity: params["ReturnConsumedCapacity"], }; const resp = await this.#client.performRequest({ opts, body, action: "TransactGetItems", }); return jsonP.readObj({ required: {}, optional: { "ConsumedCapacity": [toConsumedCapacity], "Responses": [toItemResponse], }, }, await resp.json()); }
async transactWriteItems( params: s.TransactWriteItemsInput, opts: client.RequestOptions = {}, ): Promise<s.TransactWriteItemsOutput> { const body: jsonP.JSONObject = { TransactItems: params["TransactItems"]?.map(x => fromTransactWriteItem(x)), ReturnConsumedCapacity: params["ReturnConsumedCapacity"], ReturnItemCollectionMetrics: params["ReturnItemCollectionMetrics"], ClientRequestToken: params["ClientRequestToken"] ?? generateIdemptToken(), }; const resp = await this.#client.performRequest({ opts, body, action: "TransactWriteItems", }); return jsonP.readObj({ required: {}, optional: { "ConsumedCapacity": [toConsumedCapacity], "ItemCollectionMetrics": x => jsonP.readMap(String, l => Array.isArray(l) ? l.map(toItemCollectionMetrics) : [], x), }, }, await resp.json()); }
async untagResource( params: s.UntagResourceInput, opts: client.RequestOptions = {}, ): Promise<void> { const body: jsonP.JSONObject = { ResourceArn: params["ResourceArn"], TagKeys: params["TagKeys"], }; const resp = await this.#client.performRequest({ opts, body, action: "UntagResource", }); await resp.body?.cancel(); }
async updateContinuousBackups( params: s.UpdateContinuousBackupsInput, opts: client.RequestOptions = {}, ): Promise<s.UpdateContinuousBackupsOutput> { const body: jsonP.JSONObject = { TableName: params["TableName"], PointInTimeRecoverySpecification: fromPointInTimeRecoverySpecification(params["PointInTimeRecoverySpecification"]), }; const resp = await this.#client.performRequest({ opts, body, action: "UpdateContinuousBackups", }); return jsonP.readObj({ required: {}, optional: { "ContinuousBackupsDescription": toContinuousBackupsDescription, }, }, await resp.json()); }
async updateContributorInsights( params: s.UpdateContributorInsightsInput, opts: client.RequestOptions = {}, ): Promise<s.UpdateContributorInsightsOutput> { const body: jsonP.JSONObject = { TableName: params["TableName"], IndexName: params["IndexName"], ContributorInsightsAction: params["ContributorInsightsAction"], }; const resp = await this.#client.performRequest({ opts, body, action: "UpdateContributorInsights", }); return jsonP.readObj({ required: {}, optional: { "TableName": "s", "IndexName": "s", "ContributorInsightsStatus": (x: jsonP.JSONValue) => cmnP.readEnum<s.ContributorInsightsStatus>(x), }, }, await resp.json()); }
async updateGlobalTable( params: s.UpdateGlobalTableInput, opts: client.RequestOptions = {}, ): Promise<s.UpdateGlobalTableOutput> { const body: jsonP.JSONObject = { GlobalTableName: params["GlobalTableName"], ReplicaUpdates: params["ReplicaUpdates"]?.map(x => fromReplicaUpdate(x)), }; const resp = await this.#client.performRequest({ opts, body, action: "UpdateGlobalTable", }); return jsonP.readObj({ required: {}, optional: { "GlobalTableDescription": toGlobalTableDescription, }, }, await resp.json()); }
async updateGlobalTableSettings( params: s.UpdateGlobalTableSettingsInput, opts: client.RequestOptions = {}, ): Promise<s.UpdateGlobalTableSettingsOutput> { const body: jsonP.JSONObject = { GlobalTableName: params["GlobalTableName"], GlobalTableBillingMode: params["GlobalTableBillingMode"], GlobalTableProvisionedWriteCapacityUnits: params["GlobalTableProvisionedWriteCapacityUnits"], GlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate: fromAutoScalingSettingsUpdate(params["GlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate"]), GlobalTableGlobalSecondaryIndexSettingsUpdate: params["GlobalTableGlobalSecondaryIndexSettingsUpdate"]?.map(x => fromGlobalTableGlobalSecondaryIndexSettingsUpdate(x)), ReplicaSettingsUpdate: params["ReplicaSettingsUpdate"]?.map(x => fromReplicaSettingsUpdate(x)), }; const resp = await this.#client.performRequest({ opts, body, action: "UpdateGlobalTableSettings", }); return jsonP.readObj({ required: {}, optional: { "GlobalTableName": "s", "ReplicaSettings": [toReplicaSettingsDescription], }, }, await resp.json()); }
async updateItem( params: s.UpdateItemInput, opts: client.RequestOptions = {}, ): Promise<s.UpdateItemOutput> { const body: jsonP.JSONObject = { TableName: params["TableName"], Key: jsonP.serializeMap(params["Key"], x => fromAttributeValue(x)), AttributeUpdates: jsonP.serializeMap(params["AttributeUpdates"], x => fromAttributeValueUpdate(x)), Expected: jsonP.serializeMap(params["Expected"], x => fromExpectedAttributeValue(x)), ConditionalOperator: params["ConditionalOperator"], ReturnValues: params["ReturnValues"], ReturnConsumedCapacity: params["ReturnConsumedCapacity"], ReturnItemCollectionMetrics: params["ReturnItemCollectionMetrics"], UpdateExpression: params["UpdateExpression"], ConditionExpression: params["ConditionExpression"], ExpressionAttributeNames: params["ExpressionAttributeNames"], ExpressionAttributeValues: jsonP.serializeMap(params["ExpressionAttributeValues"], x => fromAttributeValue(x)), }; const resp = await this.#client.performRequest({ opts, body, action: "UpdateItem", }); return jsonP.readObj({ required: {}, optional: { "Attributes": x => jsonP.readMap(String, toAttributeValue, x), "ConsumedCapacity": toConsumedCapacity, "ItemCollectionMetrics": toItemCollectionMetrics, }, }, await resp.json()); }
async updateTable( params: s.UpdateTableInput, opts: client.RequestOptions = {}, ): Promise<s.UpdateTableOutput> { const body: jsonP.JSONObject = { AttributeDefinitions: params["AttributeDefinitions"]?.map(x => fromAttributeDefinition(x)), TableName: params["TableName"], BillingMode: params["BillingMode"], ProvisionedThroughput: fromProvisionedThroughput(params["ProvisionedThroughput"]), GlobalSecondaryIndexUpdates: params["GlobalSecondaryIndexUpdates"]?.map(x => fromGlobalSecondaryIndexUpdate(x)), StreamSpecification: fromStreamSpecification(params["StreamSpecification"]), SSESpecification: fromSSESpecification(params["SSESpecification"]), ReplicaUpdates: params["ReplicaUpdates"]?.map(x => fromReplicationGroupUpdate(x)), TableClass: params["TableClass"], }; const resp = await this.#client.performRequest({ opts, body, action: "UpdateTable", }); return jsonP.readObj({ required: {}, optional: { "TableDescription": toTableDescription, }, }, await resp.json()); }
async updateTableReplicaAutoScaling( params: s.UpdateTableReplicaAutoScalingInput, opts: client.RequestOptions = {}, ): Promise<s.UpdateTableReplicaAutoScalingOutput> { const body: jsonP.JSONObject = { GlobalSecondaryIndexUpdates: params["GlobalSecondaryIndexUpdates"]?.map(x => fromGlobalSecondaryIndexAutoScalingUpdate(x)), TableName: params["TableName"], ProvisionedWriteCapacityAutoScalingUpdate: fromAutoScalingSettingsUpdate(params["ProvisionedWriteCapacityAutoScalingUpdate"]), ReplicaUpdates: params["ReplicaUpdates"]?.map(x => fromReplicaAutoScalingUpdate(x)), }; const resp = await this.#client.performRequest({ opts, body, action: "UpdateTableReplicaAutoScaling", }); return jsonP.readObj({ required: {}, optional: { "TableAutoScalingDescription": toTableAutoScalingDescription, }, }, await resp.json()); }
async updateTimeToLive( params: s.UpdateTimeToLiveInput, opts: client.RequestOptions = {}, ): Promise<s.UpdateTimeToLiveOutput> { const body: jsonP.JSONObject = { TableName: params["TableName"], TimeToLiveSpecification: fromTimeToLiveSpecification(params["TimeToLiveSpecification"]), }; const resp = await this.#client.performRequest({ opts, body, action: "UpdateTimeToLive", }); return jsonP.readObj({ required: {}, optional: { "TimeToLiveSpecification": toTimeToLiveSpecification, }, }, await resp.json()); }
// Resource State Waiters
/** Checks state up to 25 times, 20 seconds apart (about 9 minutes max wait time). */ async waitForTableExists( params: s.DescribeTableInput, opts: client.RequestOptions = {}, ): Promise<s.DescribeTableOutput> { const errMessage = 'ResourceNotReady: Resource is not in the state TableExists'; for (let i = 0; i < 25; i++) { try { const resp = await this.describeTable(params, opts); if (resp?.Table?.TableStatus === "ACTIVE") return resp; } catch (err) { if (!["ResourceNotFoundException"].includes(err.shortCode)) throw err; } await new Promise(r => setTimeout(r, 20000)); } throw new Error(errMessage); }
/** Checks state up to 25 times, 20 seconds apart (about 9 minutes max wait time). */ async waitForTableNotExists( params: s.DescribeTableInput, opts: client.RequestOptions = {}, ): Promise<Error | s.DescribeTableOutput> { const errMessage = 'ResourceNotReady: Resource is not in the state TableNotExists'; for (let i = 0; i < 25; i++) { try { const resp = await this.describeTable(params, opts); } catch (err) { if (["ResourceNotFoundException"].includes(err.shortCode)) return err; throw err; } await new Promise(r => setTimeout(r, 20000)); } throw new Error(errMessage); }
}
function fromBatchStatementRequest(input?: s.BatchStatementRequest | null): jsonP.JSONValue { if (!input) return input; return { Statement: input["Statement"], Parameters: input["Parameters"]?.map(x => fromAttributeValue(x)), ConsistentRead: input["ConsistentRead"], }}
function fromAttributeValue(input?: s.AttributeValue | null): jsonP.JSONValue { if (!input) return input; return { S: input["S"], N: input["N"], B: serializeBlob(input["B"]), SS: input["SS"], NS: input["NS"], BS: input["BS"]?.map(x => serializeBlob(x)), M: jsonP.serializeMap(input["M"], x => fromAttributeValue(x)), L: input["L"]?.map(x => fromAttributeValue(x)), NULL: input["NULL"], BOOL: input["BOOL"], }}function toAttributeValue(root: jsonP.JSONValue): s.AttributeValue { return jsonP.readObj({ required: {}, optional: { "S": "s", "N": "s", "B": "a", "SS": ["s"], "NS": ["s"], "BS": ["a"], "M": x => jsonP.readMap(String, toAttributeValue, x), "L": [toAttributeValue], "NULL": "b", "BOOL": "b", }, }, root);}
function fromKeysAndAttributes(input?: s.KeysAndAttributes | null): jsonP.JSONValue { if (!input) return input; return { Keys: input["Keys"]?.map(x => jsonP.serializeMap(x, fromAttributeValue)), AttributesToGet: input["AttributesToGet"], ConsistentRead: input["ConsistentRead"], ProjectionExpression: input["ProjectionExpression"], ExpressionAttributeNames: input["ExpressionAttributeNames"], }}function toKeysAndAttributes(root: jsonP.JSONValue): s.KeysAndAttributes { return jsonP.readObj({ required: { "Keys": [x => jsonP.readMap(String, toAttributeValue, x)], }, optional: { "AttributesToGet": ["s"], "ConsistentRead": "b", "ProjectionExpression": "s", "ExpressionAttributeNames": x => jsonP.readMap(String, String, x), }, }, root);}
function fromWriteRequest(input?: s.WriteRequest | null): jsonP.JSONValue { if (!input) return input; return { PutRequest: fromPutRequest(input["PutRequest"]), DeleteRequest: fromDeleteRequest(input["DeleteRequest"]), }}function toWriteRequest(root: jsonP.JSONValue): s.WriteRequest { return jsonP.readObj({ required: {}, optional: { "PutRequest": toPutRequest, "DeleteRequest": toDeleteRequest, }, }, root);}
function fromPutRequest(input?: s.PutRequest | null): jsonP.JSONValue { if (!input) return input; return { Item: jsonP.serializeMap(input["Item"], x => fromAttributeValue(x)), }}function toPutRequest(root: jsonP.JSONValue): s.PutRequest { return jsonP.readObj({ required: { "Item": x => jsonP.readMap(String, toAttributeValue, x), }, optional: {}, }, root);}
function fromDeleteRequest(input?: s.DeleteRequest | null): jsonP.JSONValue { if (!input) return input; return { Key: jsonP.serializeMap(input["Key"], x => fromAttributeValue(x)), }}function toDeleteRequest(root: jsonP.JSONValue): s.DeleteRequest { return jsonP.readObj({ required: { "Key": x => jsonP.readMap(String, toAttributeValue, x), }, optional: {}, }, root);}
function fromReplica(input?: s.Replica | null): jsonP.JSONValue { if (!input) return input; return { RegionName: input["RegionName"], }}function toReplica(root: jsonP.JSONValue): s.Replica { return jsonP.readObj({ required: {}, optional: { "RegionName": "s", }, }, root);}
function fromAttributeDefinition(input?: s.AttributeDefinition | null): jsonP.JSONValue { if (!input) return input; return { AttributeName: input["AttributeName"], AttributeType: input["AttributeType"], }}function toAttributeDefinition(root: jsonP.JSONValue): s.AttributeDefinition { return jsonP.readObj({ required: { "AttributeName": "s", "AttributeType": (x: jsonP.JSONValue) => cmnP.readEnum<s.ScalarAttributeType>(x), }, optional: {}, }, root);}
function fromKeySchemaElement(input?: s.KeySchemaElement | null): jsonP.JSONValue { if (!input) return input; return { AttributeName: input["AttributeName"], KeyType: input["KeyType"], }}function toKeySchemaElement(root: jsonP.JSONValue): s.KeySchemaElement { return jsonP.readObj({ required: { "AttributeName": "s", "KeyType": (x: jsonP.JSONValue) => cmnP.readEnum<s.KeyType>(x), }, optional: {}, }, root);}
function fromLocalSecondaryIndex(input?: s.LocalSecondaryIndex | null): jsonP.JSONValue { if (!input) return input; return { IndexName: input["IndexName"], KeySchema: input["KeySchema"]?.map(x => fromKeySchemaElement(x)), Projection: fromProjection(input["Projection"]), }}
function fromProjection(input?: s.Projection | null): jsonP.JSONValue { if (!input) return input; return { ProjectionType: input["ProjectionType"], NonKeyAttributes: input["NonKeyAttributes"], }}function toProjection(root: jsonP.JSONValue): s.Projection { return jsonP.readObj({ required: {}, optional: { "ProjectionType": (x: jsonP.JSONValue) => cmnP.readEnum<s.ProjectionType>(x), "NonKeyAttributes": ["s"], }, }, root);}
function fromGlobalSecondaryIndex(input?: s.GlobalSecondaryIndex | null): jsonP.JSONValue { if (!input) return input; return { IndexName: input["IndexName"], KeySchema: input["KeySchema"]?.map(x => fromKeySchemaElement(x)), Projection: fromProjection(input["Projection"]), ProvisionedThroughput: fromProvisionedThroughput(input["ProvisionedThroughput"]), }}
function fromProvisionedThroughput(input?: s.ProvisionedThroughput | null): jsonP.JSONValue { if (!input) return input; return { ReadCapacityUnits: input["ReadCapacityUnits"], WriteCapacityUnits: input["WriteCapacityUnits"], }}function toProvisionedThroughput(root: jsonP.JSONValue): s.ProvisionedThroughput { return jsonP.readObj({ required: { "ReadCapacityUnits": "n", "WriteCapacityUnits": "n", }, optional: {}, }, root);}
function fromStreamSpecification(input?: s.StreamSpecification | null): jsonP.JSONValue { if (!input) return input; return { StreamEnabled: input["StreamEnabled"], StreamViewType: input["StreamViewType"], }}function toStreamSpecification(root: jsonP.JSONValue): s.StreamSpecification { return jsonP.readObj({ required: { "StreamEnabled": "b", }, optional: { "StreamViewType": (x: jsonP.JSONValue) => cmnP.readEnum<s.StreamViewType>(x), }, }, root);}
function fromSSESpecification(input?: s.SSESpecification | null): jsonP.JSONValue { if (!input) return input; return { Enabled: input["Enabled"], SSEType: input["SSEType"], KMSMasterKeyId: input["KMSMasterKeyId"], }}
function fromTag(input?: s.Tag | null): jsonP.JSONValue { if (!input) return input; return { Key: input["Key"], Value: input["Value"], }}function toTag(root: jsonP.JSONValue): s.Tag { return jsonP.readObj({ required: { "Key": "s", "Value": "s", }, optional: {}, }, root);}
function fromExpectedAttributeValue(input?: s.ExpectedAttributeValue | null): jsonP.JSONValue { if (!input) return input; return { Value: fromAttributeValue(input["Value"]), Exists: input["Exists"], ComparisonOperator: input["ComparisonOperator"], AttributeValueList: input["AttributeValueList"]?.map(x => fromAttributeValue(x)), }}
function fromParameterizedStatement(input?: s.ParameterizedStatement | null): jsonP.JSONValue { if (!input) return input; return { Statement: input["Statement"], Parameters: input["Parameters"]?.map(x => fromAttributeValue(x)), }}
function fromCondition(input?: s.Condition | null): jsonP.JSONValue { if (!input) return input; return { AttributeValueList: input["AttributeValueList"]?.map(x => fromAttributeValue(x)), ComparisonOperator: input["ComparisonOperator"], }}
function fromTransactGetItem(input?: s.TransactGetItem | null): jsonP.JSONValue { if (!input) return input; return { Get: fromGet(input["Get"]), }}
function fromGet(input?: s.Get | null): jsonP.JSONValue { if (!input) return input; return { Key: jsonP.serializeMap(input["Key"], x => fromAttributeValue(x)), TableName: input["TableName"], ProjectionExpression: input["ProjectionExpression"], ExpressionAttributeNames: input["ExpressionAttributeNames"], }}
function fromTransactWriteItem(input?: s.TransactWriteItem | null): jsonP.JSONValue { if (!input) return input; return { ConditionCheck: fromConditionCheck(input["ConditionCheck"]), Put: fromPut(input["Put"]), Delete: fromDelete(input["Delete"]), Update: fromUpdate(input["Update"]), }}
function fromConditionCheck(input?: s.ConditionCheck | null): jsonP.JSONValue { if (!input) return input; return { Key: jsonP.serializeMap(input["Key"], x => fromAttributeValue(x)), TableName: input["TableName"], ConditionExpression: input["ConditionExpression"], ExpressionAttributeNames: input["ExpressionAttributeNames"], ExpressionAttributeValues: jsonP.serializeMap(input["ExpressionAttributeValues"], x => fromAttributeValue(x)), ReturnValuesOnConditionCheckFailure: input["ReturnValuesOnConditionCheckFailure"], }}
function fromPut(input?: s.Put | null): jsonP.JSONValue { if (!input) return input; return { Item: jsonP.serializeMap(input["Item"], x => fromAttributeValue(x)), TableName: input["TableName"], ConditionExpression: input["ConditionExpression"], ExpressionAttributeNames: input["ExpressionAttributeNames"], ExpressionAttributeValues: jsonP.serializeMap(input["ExpressionAttributeValues"], x => fromAttributeValue(x)), ReturnValuesOnConditionCheckFailure: input["ReturnValuesOnConditionCheckFailure"], }}
function fromDelete(input?: s.Delete | null): jsonP.JSONValue { if (!input) return input; return { Key: jsonP.serializeMap(input["Key"], x => fromAttributeValue(x)), TableName: input["TableName"], ConditionExpression: input["ConditionExpression"], ExpressionAttributeNames: input["ExpressionAttributeNames"], ExpressionAttributeValues: jsonP.serializeMap(input["ExpressionAttributeValues"], x => fromAttributeValue(x)), ReturnValuesOnConditionCheckFailure: input["ReturnValuesOnConditionCheckFailure"], }}
function fromUpdate(input?: s.Update | null): jsonP.JSONValue { if (!input) return input; return { Key: jsonP.serializeMap(input["Key"], x => fromAttributeValue(x)), UpdateExpression: input["UpdateExpression"], TableName: input["TableName"], ConditionExpression: input["ConditionExpression"], ExpressionAttributeNames: input["ExpressionAttributeNames"], ExpressionAttributeValues: jsonP.serializeMap(input["ExpressionAttributeValues"], x => fromAttributeValue(x)), ReturnValuesOnConditionCheckFailure: input["ReturnValuesOnConditionCheckFailure"], }}
function fromPointInTimeRecoverySpecification(input?: s.PointInTimeRecoverySpecification | null): jsonP.JSONValue { if (!input) return input; return { PointInTimeRecoveryEnabled: input["PointInTimeRecoveryEnabled"], }}
function fromReplicaUpdate(input?: s.ReplicaUpdate | null): jsonP.JSONValue { if (!input) return input; return { Create: fromCreateReplicaAction(input["Create"]), Delete: fromDeleteReplicaAction(input["Delete"]), }}
function fromCreateReplicaAction(input?: s.CreateReplicaAction | null): jsonP.JSONValue { if (!input) return input; return { RegionName: input["RegionName"], }}
function fromDeleteReplicaAction(input?: s.DeleteReplicaAction | null): jsonP.JSONValue { if (!input) return input; return { RegionName: input["RegionName"], }}
function fromAutoScalingSettingsUpdate(input?: s.AutoScalingSettingsUpdate | null): jsonP.JSONValue { if (!input) return input; return { MinimumUnits: input["MinimumUnits"], MaximumUnits: input["MaximumUnits"], AutoScalingDisabled: input["AutoScalingDisabled"], AutoScalingRoleArn: input["AutoScalingRoleArn"], ScalingPolicyUpdate: fromAutoScalingPolicyUpdate(input["ScalingPolicyUpdate"]), }}
function fromAutoScalingPolicyUpdate(input?: s.AutoScalingPolicyUpdate | null): jsonP.JSONValue { if (!input) return input; return { PolicyName: input["PolicyName"], TargetTrackingScalingPolicyConfiguration: fromAutoScalingTargetTrackingScalingPolicyConfigurationUpdate(input["TargetTrackingScalingPolicyConfiguration"]), }}
function fromAutoScalingTargetTrackingScalingPolicyConfigurationUpdate(input?: s.AutoScalingTargetTrackingScalingPolicyConfigurationUpdate | null): jsonP.JSONValue { if (!input) return input; return { DisableScaleIn: input["DisableScaleIn"], ScaleInCooldown: input["ScaleInCooldown"], ScaleOutCooldown: input["ScaleOutCooldown"], TargetValue: input["TargetValue"], }}
function fromGlobalTableGlobalSecondaryIndexSettingsUpdate(input?: s.GlobalTableGlobalSecondaryIndexSettingsUpdate | null): jsonP.JSONValue { if (!input) return input; return { IndexName: input["IndexName"], ProvisionedWriteCapacityUnits: input["ProvisionedWriteCapacityUnits"], ProvisionedWriteCapacityAutoScalingSettingsUpdate: fromAutoScalingSettingsUpdate(input["ProvisionedWriteCapacityAutoScalingSettingsUpdate"]), }}
function fromReplicaSettingsUpdate(input?: s.ReplicaSettingsUpdate | null): jsonP.JSONValue { if (!input) return input; return { RegionName: input["RegionName"], ReplicaProvisionedReadCapacityUnits: input["ReplicaProvisionedReadCapacityUnits"], ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate: fromAutoScalingSettingsUpdate(input["ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate"]), ReplicaGlobalSecondaryIndexSettingsUpdate: input["ReplicaGlobalSecondaryIndexSettingsUpdate"]?.map(x => fromReplicaGlobalSecondaryIndexSettingsUpdate(x)), ReplicaTableClass: input["ReplicaTableClass"], }}
function fromReplicaGlobalSecondaryIndexSettingsUpdate(input?: s.ReplicaGlobalSecondaryIndexSettingsUpdate | null): jsonP.JSONValue { if (!input) return input; return { IndexName: input["IndexName"], ProvisionedReadCapacityUnits: input["ProvisionedReadCapacityUnits"], ProvisionedReadCapacityAutoScalingSettingsUpdate: fromAutoScalingSettingsUpdate(input["ProvisionedReadCapacityAutoScalingSettingsUpdate"]), }}
function fromAttributeValueUpdate(input?: s.AttributeValueUpdate | null): jsonP.JSONValue { if (!input) return input; return { Value: fromAttributeValue(input["Value"]), Action: input["Action"], }}
function fromGlobalSecondaryIndexUpdate(input?: s.GlobalSecondaryIndexUpdate | null): jsonP.JSONValue { if (!input) return input; return { Update: fromUpdateGlobalSecondaryIndexAction(input["Update"]), Create: fromCreateGlobalSecondaryIndexAction(input["Create"]), Delete: fromDeleteGlobalSecondaryIndexAction(input["Delete"]), }}
function fromUpdateGlobalSecondaryIndexAction(input?: s.UpdateGlobalSecondaryIndexAction | null): jsonP.JSONValue { if (!input) return input; return { IndexName: input["IndexName"], ProvisionedThroughput: fromProvisionedThroughput(input["ProvisionedThroughput"]), }}
function fromCreateGlobalSecondaryIndexAction(input?: s.CreateGlobalSecondaryIndexAction | null): jsonP.JSONValue { if (!input) return input; return { IndexName: input["IndexName"], KeySchema: input["KeySchema"]?.map(x => fromKeySchemaElement(x)), Projection: fromProjection(input["Projection"]), ProvisionedThroughput: fromProvisionedThroughput(input["ProvisionedThroughput"]), }}
function fromDeleteGlobalSecondaryIndexAction(input?: s.DeleteGlobalSecondaryIndexAction | null): jsonP.JSONValue { if (!input) return input; return { IndexName: input["IndexName"], }}
function fromReplicationGroupUpdate(input?: s.ReplicationGroupUpdate | null): jsonP.JSONValue { if (!input) return input; return { Create: fromCreateReplicationGroupMemberAction(input["Create"]), Update: fromUpdateReplicationGroupMemberAction(input["Update"]), Delete: fromDeleteReplicationGroupMemberAction(input["Delete"]), }}
function fromCreateReplicationGroupMemberAction(input?: s.CreateReplicationGroupMemberAction | null): jsonP.JSONValue { if (!input) return input; return { RegionName: input["RegionName"], KMSMasterKeyId: input["KMSMasterKeyId"], ProvisionedThroughputOverride: fromProvisionedThroughputOverride(input["ProvisionedThroughputOverride"]), GlobalSecondaryIndexes: input["GlobalSecondaryIndexes"]?.map(x => fromReplicaGlobalSecondaryIndex(x)), TableClassOverride: input["TableClassOverride"], }}
function fromProvisionedThroughputOverride(input?: s.ProvisionedThroughputOverride | null): jsonP.JSONValue { if (!input) return input; return { ReadCapacityUnits: input["ReadCapacityUnits"], }}function toProvisionedThroughputOverride(root: jsonP.JSONValue): s.ProvisionedThroughputOverride { return jsonP.readObj({ required: {}, optional: { "ReadCapacityUnits": "n", }, }, root);}
function fromReplicaGlobalSecondaryIndex(input?: s.ReplicaGlobalSecondaryIndex | null): jsonP.JSONValue { if (!input) return input; return { IndexName: input["IndexName"], ProvisionedThroughputOverride: fromProvisionedThroughputOverride(input["ProvisionedThroughputOverride"]), }}
function fromUpdateReplicationGroupMemberAction(input?: s.UpdateReplicationGroupMemberAction | null): jsonP.JSONValue { if (!input) return input; return { RegionName: input["RegionName"], KMSMasterKeyId: input["KMSMasterKeyId"], ProvisionedThroughputOverride: fromProvisionedThroughputOverride(input["ProvisionedThroughputOverride"]), GlobalSecondaryIndexes: input["GlobalSecondaryIndexes"]?.map(x => fromReplicaGlobalSecondaryIndex(x)), TableClassOverride: input["TableClassOverride"], }}
function fromDeleteReplicationGroupMemberAction(input?: s.DeleteReplicationGroupMemberAction | null): jsonP.JSONValue { if (!input) return input; return { RegionName: input["RegionName"], }}
function fromGlobalSecondaryIndexAutoScalingUpdate(input?: s.GlobalSecondaryIndexAutoScalingUpdate | null): jsonP.JSONValue { if (!input) return input; return { IndexName: input["IndexName"], ProvisionedWriteCapacityAutoScalingUpdate: fromAutoScalingSettingsUpdate(input["ProvisionedWriteCapacityAutoScalingUpdate"]), }}
function fromReplicaAutoScalingUpdate(input?: s.ReplicaAutoScalingUpdate | null): jsonP.JSONValue { if (!input) return input; return { RegionName: input["RegionName"], ReplicaGlobalSecondaryIndexUpdates: input["ReplicaGlobalSecondaryIndexUpdates"]?.map(x => fromReplicaGlobalSecondaryIndexAutoScalingUpdate(x)), ReplicaProvisionedReadCapacityAutoScalingUpdate: fromAutoScalingSettingsUpdate(input["ReplicaProvisionedReadCapacityAutoScalingUpdate"]), }}
function fromReplicaGlobalSecondaryIndexAutoScalingUpdate(input?: s.ReplicaGlobalSecondaryIndexAutoScalingUpdate | null): jsonP.JSONValue { if (!input) return input; return { IndexName: input["IndexName"], ProvisionedReadCapacityAutoScalingUpdate: fromAutoScalingSettingsUpdate(input["ProvisionedReadCapacityAutoScalingUpdate"]), }}
function fromTimeToLiveSpecification(input?: s.TimeToLiveSpecification | null): jsonP.JSONValue { if (!input) return input; return { Enabled: input["Enabled"], AttributeName: input["AttributeName"], }}function toTimeToLiveSpecification(root: jsonP.JSONValue): s.TimeToLiveSpecification { return jsonP.readObj({ required: { "Enabled": "b", "AttributeName": "s", }, optional: {}, }, root);}
function toBatchStatementResponse(root: jsonP.JSONValue): s.BatchStatementResponse { return jsonP.readObj({ required: {}, optional: { "Error": toBatchStatementError, "TableName": "s", "Item": x => jsonP.readMap(String, toAttributeValue, x), }, }, root);}
function toBatchStatementError(root: jsonP.JSONValue): s.BatchStatementError { return jsonP.readObj({ required: {}, optional: { "Code": (x: jsonP.JSONValue) => cmnP.readEnum<s.BatchStatementErrorCodeEnum>(x), "Message": "s", }, }, root);}
function toConsumedCapacity(root: jsonP.JSONValue): s.ConsumedCapacity { return jsonP.readObj({ required: {}, optional: { "TableName": "s", "CapacityUnits": "n", "ReadCapacityUnits": "n", "WriteCapacityUnits": "n", "Table": toCapacity, "LocalSecondaryIndexes": x => jsonP.readMap(String, toCapacity, x), "GlobalSecondaryIndexes": x => jsonP.readMap(String, toCapacity, x), }, }, root);}
function toCapacity(root: jsonP.JSONValue): s.Capacity { return jsonP.readObj({ required: {}, optional: { "ReadCapacityUnits": "n", "WriteCapacityUnits": "n", "CapacityUnits": "n", }, }, root);}
function toItemCollectionMetrics(root: jsonP.JSONValue): s.ItemCollectionMetrics { return jsonP.readObj({ required: {}, optional: { "ItemCollectionKey": x => jsonP.readMap(String, toAttributeValue, x), "SizeEstimateRangeGB": ["n"], }, }, root);}
function toBackupDetails(root: jsonP.JSONValue): s.BackupDetails { return jsonP.readObj({ required: { "BackupArn": "s", "BackupName": "s", "BackupStatus": (x: jsonP.JSONValue) => cmnP.readEnum<s.BackupStatus>(x), "BackupType": (x: jsonP.JSONValue) => cmnP.readEnum<s.BackupType>(x), "BackupCreationDateTime": "d", }, optional: { "BackupSizeBytes": "n", "BackupExpiryDateTime": "d", }, }, root);}
function toGlobalTableDescription(root: jsonP.JSONValue): s.GlobalTableDescription { return jsonP.readObj({ required: {}, optional: { "ReplicationGroup": [toReplicaDescription], "GlobalTableArn": "s", "CreationDateTime": "d", "GlobalTableStatus": (x: jsonP.JSONValue) => cmnP.readEnum<s.GlobalTableStatus>(x), "GlobalTableName": "s", }, }, root);}
function toReplicaDescription(root: jsonP.JSONValue): s.ReplicaDescription { return jsonP.readObj({ required: {}, optional: { "RegionName": "s", "ReplicaStatus": (x: jsonP.JSONValue) => cmnP.readEnum<s.ReplicaStatus>(x), "ReplicaStatusDescription": "s", "ReplicaStatusPercentProgress": "s", "KMSMasterKeyId": "s", "ProvisionedThroughputOverride": toProvisionedThroughputOverride, "GlobalSecondaryIndexes": [toReplicaGlobalSecondaryIndexDescription], "ReplicaInaccessibleDateTime": "d", "ReplicaTableClassSummary": toTableClassSummary, }, }, root);}
function toReplicaGlobalSecondaryIndexDescription(root: jsonP.JSONValue): s.ReplicaGlobalSecondaryIndexDescription { return jsonP.readObj({ required: {}, optional: { "IndexName": "s", "ProvisionedThroughputOverride": toProvisionedThroughputOverride, }, }, root);}
function toTableClassSummary(root: jsonP.JSONValue): s.TableClassSummary { return jsonP.readObj({ required: {}, optional: { "TableClass": (x: jsonP.JSONValue) => cmnP.readEnum<s.TableClass>(x), "LastUpdateDateTime": "d", }, }, root);}
function toTableDescription(root: jsonP.JSONValue): s.TableDescription { return jsonP.readObj({ required: {}, optional: { "AttributeDefinitions": [toAttributeDefinition], "TableName": "s", "KeySchema": [toKeySchemaElement], "TableStatus": (x: jsonP.JSONValue) => cmnP.readEnum<s.TableStatus>(x), "CreationDateTime": "d", "ProvisionedThroughput": toProvisionedThroughputDescription, "TableSizeBytes": "n", "ItemCount": "n", "TableArn": "s", "TableId": "s", "BillingModeSummary": toBillingModeSummary, "LocalSecondaryIndexes": [toLocalSecondaryIndexDescription], "GlobalSecondaryIndexes": [toGlobalSecondaryIndexDescription], "StreamSpecification": toStreamSpecification, "LatestStreamLabel": "s", "LatestStreamArn": "s", "GlobalTableVersion": "s", "Replicas": [toReplicaDescription], "RestoreSummary": toRestoreSummary, "SSEDescription": toSSEDescription, "ArchivalSummary": toArchivalSummary, "TableClassSummary": toTableClassSummary, }, }, root);}
function toProvisionedThroughputDescription(root: jsonP.JSONValue): s.ProvisionedThroughputDescription { return jsonP.readObj({ required: {}, optional: { "LastIncreaseDateTime": "d", "LastDecreaseDateTime": "d", "NumberOfDecreasesToday": "n", "ReadCapacityUnits": "n", "WriteCapacityUnits": "n", }, }, root);}
function toBillingModeSummary(root: jsonP.JSONValue): s.BillingModeSummary { return jsonP.readObj({ required: {}, optional: { "BillingMode": (x: jsonP.JSONValue) => cmnP.readEnum<s.BillingMode>(x), "LastUpdateToPayPerRequestDateTime": "d", }, }, root);}
function toLocalSecondaryIndexDescription(root: jsonP.JSONValue): s.LocalSecondaryIndexDescription { return jsonP.readObj({ required: {}, optional: { "IndexName": "s", "KeySchema": [toKeySchemaElement], "Projection": toProjection, "IndexSizeBytes": "n", "ItemCount": "n", "IndexArn": "s", }, }, root);}
function toGlobalSecondaryIndexDescription(root: jsonP.JSONValue): s.GlobalSecondaryIndexDescription { return jsonP.readObj({ required: {}, optional: { "IndexName": "s", "KeySchema": [toKeySchemaElement], "Projection": toProjection, "IndexStatus": (x: jsonP.JSONValue) => cmnP.readEnum<s.IndexStatus>(x), "Backfilling": "b", "ProvisionedThroughput": toProvisionedThroughputDescription, "IndexSizeBytes": "n", "ItemCount": "n", "IndexArn": "s", }, }, root);}
function toRestoreSummary(root: jsonP.JSONValue): s.RestoreSummary { return jsonP.readObj({ required: { "RestoreDateTime": "d", "RestoreInProgress": "b", }, optional: { "SourceBackupArn": "s", "SourceTableArn": "s", }, }, root);}
function toSSEDescription(root: jsonP.JSONValue): s.SSEDescription { return jsonP.readObj({ required: {}, optional: { "Status": (x: jsonP.JSONValue) => cmnP.readEnum<s.SSEStatus>(x), "SSEType": (x: jsonP.JSONValue) => cmnP.readEnum<s.SSEType>(x), "KMSMasterKeyArn": "s", "InaccessibleEncryptionDateTime": "d", }, }, root);}
function toArchivalSummary(root: jsonP.JSONValue): s.ArchivalSummary { return jsonP.readObj({ required: {}, optional: { "ArchivalDateTime": "d", "ArchivalReason": "s", "ArchivalBackupArn": "s", }, }, root);}
function toBackupDescription(root: jsonP.JSONValue): s.BackupDescription { return jsonP.readObj({ required: {}, optional: { "BackupDetails": toBackupDetails, "SourceTableDetails": toSourceTableDetails, "SourceTableFeatureDetails": toSourceTableFeatureDetails, }, }, root);}
function toSourceTableDetails(root: jsonP.JSONValue): s.SourceTableDetails { return jsonP.readObj({ required: { "TableName": "s", "TableId": "s", "KeySchema": [toKeySchemaElement], "TableCreationDateTime": "d", "ProvisionedThroughput": toProvisionedThroughput, }, optional: { "TableArn": "s", "TableSizeBytes": "n", "ItemCount": "n", "BillingMode": (x: jsonP.JSONValue) => cmnP.readEnum<s.BillingMode>(x), }, }, root);}
function toSourceTableFeatureDetails(root: jsonP.JSONValue): s.SourceTableFeatureDetails { return jsonP.readObj({ required: {}, optional: { "LocalSecondaryIndexes": [toLocalSecondaryIndexInfo], "GlobalSecondaryIndexes": [toGlobalSecondaryIndexInfo], "StreamDescription": toStreamSpecification, "TimeToLiveDescription": toTimeToLiveDescription, "SSEDescription": toSSEDescription, }, }, root);}
function toLocalSecondaryIndexInfo(root: jsonP.JSONValue): s.LocalSecondaryIndexInfo { return jsonP.readObj({ required: {}, optional: { "IndexName": "s", "KeySchema": [toKeySchemaElement], "Projection": toProjection, }, }, root);}
function toGlobalSecondaryIndexInfo(root: jsonP.JSONValue): s.GlobalSecondaryIndexInfo { return jsonP.readObj({ required: {}, optional: { "IndexName": "s", "KeySchema": [toKeySchemaElement], "Projection": toProjection, "ProvisionedThroughput": toProvisionedThroughput, }, }, root);}
function toTimeToLiveDescription(root: jsonP.JSONValue): s.TimeToLiveDescription { return jsonP.readObj({ required: {}, optional: { "TimeToLiveStatus": (x: jsonP.JSONValue) => cmnP.readEnum<s.TimeToLiveStatus>(x), "AttributeName": "s", }, }, root);}
function toContinuousBackupsDescription(root: jsonP.JSONValue): s.ContinuousBackupsDescription { return jsonP.readObj({ required: { "ContinuousBackupsStatus": (x: jsonP.JSONValue) => cmnP.readEnum<s.ContinuousBackupsStatus>(x), }, optional: { "PointInTimeRecoveryDescription": toPointInTimeRecoveryDescription, }, }, root);}
function toPointInTimeRecoveryDescription(root: jsonP.JSONValue): s.PointInTimeRecoveryDescription { return jsonP.readObj({ required: {}, optional: { "PointInTimeRecoveryStatus": (x: jsonP.JSONValue) => cmnP.readEnum<s.PointInTimeRecoveryStatus>(x), "EarliestRestorableDateTime": "d", "LatestRestorableDateTime": "d", }, }, root);}
function toFailureException(root: jsonP.JSONValue): s.FailureException { return jsonP.readObj({ required: {}, optional: { "ExceptionName": "s", "ExceptionDescription": "s", }, }, root);}
function toEndpoint(root: jsonP.JSONValue): s.Endpoint { return jsonP.readObj({ required: { "Address": "s", "CachePeriodInMinutes": "n", }, optional: {}, }, root);}
function toExportDescription(root: jsonP.JSONValue): s.ExportDescription { return jsonP.readObj({ required: {}, optional: { "ExportArn": "s", "ExportStatus": (x: jsonP.JSONValue) => cmnP.readEnum<s.ExportStatus>(x), "StartTime": "d", "EndTime": "d", "ExportManifest": "s", "TableArn": "s", "TableId": "s", "ExportTime": "d", "ClientToken": "s", "S3Bucket": "s", "S3BucketOwner": "s", "S3Prefix": "s", "S3SseAlgorithm": (x: jsonP.JSONValue) => cmnP.readEnum<s.S3SseAlgorithm>(x), "S3SseKmsKeyId": "s", "FailureCode": "s", "FailureMessage": "s", "ExportFormat": (x: jsonP.JSONValue) => cmnP.readEnum<s.ExportFormat>(x), "BilledSizeBytes": "n", "ItemCount": "n", }, }, root);}
function toReplicaSettingsDescription(root: jsonP.JSONValue): s.ReplicaSettingsDescription { return jsonP.readObj({ required: { "RegionName": "s", }, optional: { "ReplicaStatus": (x: jsonP.JSONValue) => cmnP.readEnum<s.ReplicaStatus>(x), "ReplicaBillingModeSummary": toBillingModeSummary, "ReplicaProvisionedReadCapacityUnits": "n", "ReplicaProvisionedReadCapacityAutoScalingSettings": toAutoScalingSettingsDescription, "ReplicaProvisionedWriteCapacityUnits": "n", "ReplicaProvisionedWriteCapacityAutoScalingSettings": toAutoScalingSettingsDescription, "ReplicaGlobalSecondaryIndexSettings": [toReplicaGlobalSecondaryIndexSettingsDescription], "ReplicaTableClassSummary": toTableClassSummary, }, }, root);}
function toAutoScalingSettingsDescription(root: jsonP.JSONValue): s.AutoScalingSettingsDescription { return jsonP.readObj({ required: {}, optional: { "MinimumUnits": "n", "MaximumUnits": "n", "AutoScalingDisabled": "b", "AutoScalingRoleArn": "s", "ScalingPolicies": [toAutoScalingPolicyDescription], }, }, root);}
function toAutoScalingPolicyDescription(root: jsonP.JSONValue): s.AutoScalingPolicyDescription { return jsonP.readObj({ required: {}, optional: { "PolicyName": "s", "TargetTrackingScalingPolicyConfiguration": toAutoScalingTargetTrackingScalingPolicyConfigurationDescription, }, }, root);}
function toAutoScalingTargetTrackingScalingPolicyConfigurationDescription(root: jsonP.JSONValue): s.AutoScalingTargetTrackingScalingPolicyConfigurationDescription { return jsonP.readObj({ required: { "TargetValue": "n", }, optional: { "DisableScaleIn": "b", "ScaleInCooldown": "n", "ScaleOutCooldown": "n", }, }, root);}
function toReplicaGlobalSecondaryIndexSettingsDescription(root: jsonP.JSONValue): s.ReplicaGlobalSecondaryIndexSettingsDescription { return jsonP.readObj({ required: { "IndexName": "s", }, optional: { "IndexStatus": (x: jsonP.JSONValue) => cmnP.readEnum<s.IndexStatus>(x), "ProvisionedReadCapacityUnits": "n", "ProvisionedReadCapacityAutoScalingSettings": toAutoScalingSettingsDescription, "ProvisionedWriteCapacityUnits": "n", "ProvisionedWriteCapacityAutoScalingSettings": toAutoScalingSettingsDescription, }, }, root);}
function toKinesisDataStreamDestination(root: jsonP.JSONValue): s.KinesisDataStreamDestination { return jsonP.readObj({ required: {}, optional: { "StreamArn": "s", "DestinationStatus": (x: jsonP.JSONValue) => cmnP.readEnum<s.DestinationStatus>(x), "DestinationStatusDescription": "s", }, }, root);}
function toTableAutoScalingDescription(root: jsonP.JSONValue): s.TableAutoScalingDescription { return jsonP.readObj({ required: {}, optional: { "TableName": "s", "TableStatus": (x: jsonP.JSONValue) => cmnP.readEnum<s.TableStatus>(x), "Replicas": [toReplicaAutoScalingDescription], }, }, root);}
function toReplicaAutoScalingDescription(root: jsonP.JSONValue): s.ReplicaAutoScalingDescription { return jsonP.readObj({ required: {}, optional: { "RegionName": "s", "GlobalSecondaryIndexes": [toReplicaGlobalSecondaryIndexAutoScalingDescription], "ReplicaProvisionedReadCapacityAutoScalingSettings": toAutoScalingSettingsDescription, "ReplicaProvisionedWriteCapacityAutoScalingSettings": toAutoScalingSettingsDescription, "ReplicaStatus": (x: jsonP.JSONValue) => cmnP.readEnum<s.ReplicaStatus>(x), }, }, root);}
function toReplicaGlobalSecondaryIndexAutoScalingDescription(root: jsonP.JSONValue): s.ReplicaGlobalSecondaryIndexAutoScalingDescription { return jsonP.readObj({ required: {}, optional: { "IndexName": "s", "IndexStatus": (x: jsonP.JSONValue) => cmnP.readEnum<s.IndexStatus>(x), "ProvisionedReadCapacityAutoScalingSettings": toAutoScalingSettingsDescription, "ProvisionedWriteCapacityAutoScalingSettings": toAutoScalingSettingsDescription, }, }, root);}
function toItemResponse(root: jsonP.JSONValue): s.ItemResponse { return jsonP.readObj({ required: {}, optional: { "Item": x => jsonP.readMap(String, toAttributeValue, x), }, }, root);}
function toBackupSummary(root: jsonP.JSONValue): s.BackupSummary { return jsonP.readObj({ required: {}, optional: { "TableName": "s", "TableId": "s", "TableArn": "s", "BackupArn": "s", "BackupName": "s", "BackupCreationDateTime": "d", "BackupExpiryDateTime": "d", "BackupStatus": (x: jsonP.JSONValue) => cmnP.readEnum<s.BackupStatus>(x), "BackupType": (x: jsonP.JSONValue) => cmnP.readEnum<s.BackupType>(x), "BackupSizeBytes": "n", }, }, root);}
function toContributorInsightsSummary(root: jsonP.JSONValue): s.ContributorInsightsSummary { return jsonP.readObj({ required: {}, optional: { "TableName": "s", "IndexName": "s", "ContributorInsightsStatus": (x: jsonP.JSONValue) => cmnP.readEnum<s.ContributorInsightsStatus>(x), }, }, root);}
function toExportSummary(root: jsonP.JSONValue): s.ExportSummary { return jsonP.readObj({ required: {}, optional: { "ExportArn": "s", "ExportStatus": (x: jsonP.JSONValue) => cmnP.readEnum<s.ExportStatus>(x), }, }, root);}
function toGlobalTable(root: jsonP.JSONValue): s.GlobalTable { return jsonP.readObj({ required: {}, optional: { "GlobalTableName": "s", "ReplicationGroup": [toReplica], }, }, root);}