/* * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is * regenerated. */ import * as msRest from "@azure/ms-rest-js"; import * as Models from "../models"; import * as Mappers from "../models/contactsTableDataMappers"; import * as Parameters from "../models/parameters"; import { Office365ConnectorContext } from "../office365ConnectorContext"; /** Class representing a ContactsTableData. */ export class ContactsTableData { private readonly client: Office365ConnectorContext; /** * Create a ContactsTableData. * @param {Office365ConnectorContext} client Reference to the service client. */ constructor(client: Office365ConnectorContext) { this.client = client; } /** * This operation gets contacts from a contacts folder. * @summary Get contacts * @param table Unique identifier of the contacts folder to retrieve * @param [options] The optional parameters * @deprecated This operation is deprecated. Please do not use it any longer. * @returns Promise */ contactGetItems(table: string, options?: Models.ContactsTableDataContactGetItemsOptionalParams): Promise; /** * @param table Unique identifier of the contacts folder to retrieve * @param callback The callback * @deprecated This operation is deprecated. Please do not use it any longer. */ contactGetItems(table: string, callback: msRest.ServiceCallback): void; /** * @param table Unique identifier of the contacts folder to retrieve * @param options The optional parameters * @param callback The callback * @deprecated This operation is deprecated. Please do not use it any longer. */ contactGetItems(table: string, options: Models.ContactsTableDataContactGetItemsOptionalParams, callback: msRest.ServiceCallback): void; contactGetItems(table: string, options?: Models.ContactsTableDataContactGetItemsOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { table, options }, contactGetItemsOperationSpec, callback) as Promise; } /** * This operation creates a new contact in a contacts folder. * @summary Create contact * @param table Select a contacts folder * @param item Contact to create * @param [options] The optional parameters * @deprecated This operation is deprecated. Please do not use it any longer. * @returns Promise */ contactPostItem(table: string, item: Models.Contact, options?: msRest.RequestOptionsBase): Promise; /** * @param table Select a contacts folder * @param item Contact to create * @param callback The callback * @deprecated This operation is deprecated. Please do not use it any longer. */ contactPostItem(table: string, item: Models.Contact, callback: msRest.ServiceCallback): void; /** * @param table Select a contacts folder * @param item Contact to create * @param options The optional parameters * @param callback The callback * @deprecated This operation is deprecated. Please do not use it any longer. */ contactPostItem(table: string, item: Models.Contact, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; contactPostItem(table: string, item: Models.Contact, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { table, item, options }, contactPostItemOperationSpec, callback) as Promise; } /** * This operation deletes a contact from a contacts folder. * @summary Delete contact * @param table Select a contacts folder * @param id Unique identifier of contact to delete * @param [options] The optional parameters * @deprecated This operation is deprecated. Please do not use it any longer. * @returns Promise */ contactDeleteItem(table: string, id: string, options?: msRest.RequestOptionsBase): Promise; /** * @param table Select a contacts folder * @param id Unique identifier of contact to delete * @param callback The callback * @deprecated This operation is deprecated. Please do not use it any longer. */ contactDeleteItem(table: string, id: string, callback: msRest.ServiceCallback): void; /** * @param table Select a contacts folder * @param id Unique identifier of contact to delete * @param options The optional parameters * @param callback The callback * @deprecated This operation is deprecated. Please do not use it any longer. */ contactDeleteItem(table: string, id: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; contactDeleteItem(table: string, id: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { table, id, options }, contactDeleteItemOperationSpec, callback); } /** * This operation gets a specific contact from a contacts folder. * @summary Get contact * @param table Select a contacts folder * @param id Unique identifier of a contact to retrieve * @param [options] The optional parameters * @deprecated This operation is deprecated. Please do not use it any longer. * @returns Promise */ contactGetItem(table: string, id: string, options?: msRest.RequestOptionsBase): Promise; /** * @param table Select a contacts folder * @param id Unique identifier of a contact to retrieve * @param callback The callback * @deprecated This operation is deprecated. Please do not use it any longer. */ contactGetItem(table: string, id: string, callback: msRest.ServiceCallback): void; /** * @param table Select a contacts folder * @param id Unique identifier of a contact to retrieve * @param options The optional parameters * @param callback The callback * @deprecated This operation is deprecated. Please do not use it any longer. */ contactGetItem(table: string, id: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; contactGetItem(table: string, id: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { table, id, options }, contactGetItemOperationSpec, callback) as Promise; } /** * This operation updates a contact in a contacts folder. * @summary Update contact * @param table Select a contacts folder * @param id Unique identifier of contact to update * @param item Contact item to update * @param [options] The optional parameters * @deprecated This operation is deprecated. Please do not use it any longer. * @returns Promise */ contactPatchItem(table: string, id: string, item: Models.Contact, options?: msRest.RequestOptionsBase): Promise; /** * @param table Select a contacts folder * @param id Unique identifier of contact to update * @param item Contact item to update * @param callback The callback * @deprecated This operation is deprecated. Please do not use it any longer. */ contactPatchItem(table: string, id: string, item: Models.Contact, callback: msRest.ServiceCallback): void; /** * @param table Select a contacts folder * @param id Unique identifier of contact to update * @param item Contact item to update * @param options The optional parameters * @param callback The callback * @deprecated This operation is deprecated. Please do not use it any longer. */ contactPatchItem(table: string, id: string, item: Models.Contact, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; contactPatchItem(table: string, id: string, item: Models.Contact, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { table, id, item, options }, contactPatchItemOperationSpec, callback) as Promise; } } // Operation Specifications const serializer = new msRest.Serializer(Mappers); const contactGetItemsOperationSpec: msRest.OperationSpec = { httpMethod: "GET", path: "apim/office365/{connectionId}/datasets/contacts/tables/{table}/items", urlParameters: [ Parameters.connectionId, Parameters.table ], queryParameters: [ Parameters.filter, Parameters.orderby, Parameters.top2, Parameters.skip1 ], responses: { 200: { bodyMapper: Mappers.EntityListResponseContactResponse }, default: {} }, serializer }; const contactPostItemOperationSpec: msRest.OperationSpec = { httpMethod: "POST", path: "apim/office365/{connectionId}/datasets/contacts/tables/{table}/items", urlParameters: [ Parameters.connectionId, Parameters.table ], requestBody: { parameterPath: "item", mapper: { ...Mappers.Contact, required: true } }, responses: { 200: { bodyMapper: Mappers.ContactResponse }, default: {} }, serializer }; const contactDeleteItemOperationSpec: msRest.OperationSpec = { httpMethod: "DELETE", path: "apim/office365/{connectionId}/datasets/contacts/tables/{table}/items/{id}", urlParameters: [ Parameters.connectionId, Parameters.table, Parameters.id ], responses: { 200: {}, default: {} }, serializer }; const contactGetItemOperationSpec: msRest.OperationSpec = { httpMethod: "GET", path: "apim/office365/{connectionId}/datasets/contacts/tables/{table}/items/{id}", urlParameters: [ Parameters.connectionId, Parameters.table, Parameters.id ], responses: { 200: { bodyMapper: Mappers.ContactResponse }, default: {} }, serializer }; const contactPatchItemOperationSpec: msRest.OperationSpec = { httpMethod: "PATCH", path: "apim/office365/{connectionId}/datasets/contacts/tables/{table}/items/{id}", urlParameters: [ Parameters.connectionId, Parameters.table, Parameters.id ], requestBody: { parameterPath: "item", mapper: { ...Mappers.Contact, required: true } }, responses: { 200: { bodyMapper: Mappers.ContactResponse }, default: {} }, serializer };