import { PagedAsyncIterableIterator } from "@azure/core-paging" ; import { TableOperations } from "../operationsInterfaces" ; import * as coreClient from "@azure/core-client" ; import * as Mappers from "../models/mappers" ; import * as Parameters from "../models/parameters" ; import { StorageManagementClient } from "../storageManagementClient" ; import { Table , TableListNextOptionalParams , TableListOptionalParams , TableCreateOptionalParams , TableCreateResponse , TableUpdateOptionalParams , TableUpdateResponse , TableGetOptionalParams , TableGetResponse , TableDeleteOptionalParams , TableListResponse , TableListNextResponse } from "../models" ; /** Class containing TableOperations operations. */ export class TableOperationsImpl implements TableOperations { private readonly client : StorageManagementClient ; param client constructor ( client ) { this . client = client ; } param resourceGroupName param accountName param options public list ( resourceGroupName , accountName , options ? ) { const iter = this . listPagingAll ( resourceGroupName , accountName , options ) ; return { next ( ) { return iter . next ( ) ; } , [ Symbol . asyncIterator ] ( ) { return this ; } , byPage : ( ) => { return this . listPagingPage ( resourceGroupName , accountName , options ) ; } } ; } private async * listPagingPage ( resourceGroupName , accountName , options ? ) { let result = await this . _list ( resourceGroupName , accountName , options ) ; yield result . value || [ ] ; let continuationToken = result . nextLink ; while ( continuationToken ) { result = await this . _listNext ( resourceGroupName , accountName , continuationToken , options ) ; continuationToken = result . nextLink ; yield result . value || [ ] ; } } private async * listPagingAll ( resourceGroupName , accountName , options ? ) { for await ( const page of this . listPagingPage ( resourceGroupName , accountName , options ) ) { yield * page ; } } param resourceGroupName param accountName param tableName param options create ( resourceGroupName , accountName , tableName , options ? ) { return this . client . sendOperationRequest ( { resourceGroupName , accountName , tableName , options } , createOperationSpec ) ; } param resourceGroupName param accountName param tableName param options update ( resourceGroupName , accountName , tableName , options ? ) { return this . client . sendOperationRequest ( { resourceGroupName , accountName , tableName , options } , updateOperationSpec ) ; } param resourceGroupName param accountName param tableName param options get ( resourceGroupName , accountName , tableName , options ? ) { return this . client . sendOperationRequest ( { resourceGroupName , accountName , tableName , options } , getOperationSpec ) ; } param resourceGroupName param accountName param tableName param options delete ( resourceGroupName , accountName , tableName , options ? ) { return this . client . sendOperationRequest ( { resourceGroupName , accountName , tableName , options } , deleteOperationSpec ) ; } param resourceGroupName param accountName param options private _list ( resourceGroupName , accountName , options ? ) { return this . client . sendOperationRequest ( { resourceGroupName , accountName , options } , listOperationSpec ) ; } param resourceGroupName param accountName param nextLink param options private _listNext ( resourceGroupName , accountName , nextLink , options ? ) { return this . client . sendOperationRequest ( { resourceGroupName , accountName , nextLink , options } , listNextOperationSpec ) ; } } const serializer = coreClient . createSerializer ( Mappers , false ) ; const createOperationSpec = { path : "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}" , httpMethod : "PUT" , responses : { 200 : { bodyMapper : Mappers . Table } , default : { bodyMapper : Mappers . CloudErrorAutoGenerated } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . subscriptionId , Parameters . resourceGroupName , Parameters . accountName1 , Parameters . tableName ] , headerParameters : [ Parameters . accept ] , serializer } ; const updateOperationSpec = { path : "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}" , httpMethod : "PATCH" , responses : { 200 : { bodyMapper : Mappers . Table } , default : { bodyMapper : Mappers . CloudErrorAutoGenerated } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . subscriptionId , Parameters . resourceGroupName , Parameters . accountName1 , Parameters . tableName ] , headerParameters : [ Parameters . accept ] , serializer } ; const getOperationSpec = { path : "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . Table } , default : { bodyMapper : Mappers . CloudErrorAutoGenerated } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . subscriptionId , Parameters . resourceGroupName , Parameters . accountName1 , Parameters . tableName ] , headerParameters : [ Parameters . accept ] , serializer } ; const deleteOperationSpec = { path : "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}" , httpMethod : "DELETE" , responses : { 204 : { } , default : { bodyMapper : Mappers . CloudErrorAutoGenerated } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . subscriptionId , Parameters . resourceGroupName , Parameters . accountName1 , Parameters . tableName ] , headerParameters : [ Parameters . accept ] , serializer } ; const listOperationSpec = { path : "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . ListTableResource } , default : { bodyMapper : Mappers . CloudErrorAutoGenerated } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . subscriptionId , Parameters . resourceGroupName , Parameters . accountName1 ] , headerParameters : [ Parameters . accept ] , serializer } ; const listNextOperationSpec = { path : "{nextLink}" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . ListTableResource } , default : { bodyMapper : Mappers . CloudErrorAutoGenerated } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . subscriptionId , Parameters . resourceGroupName , Parameters . accountName1 , Parameters . nextLink ] , headerParameters : [ Parameters . accept ] , serializer } ;