protocol.uts 1.8 KB
Newer Older
DCloud-yyl's avatar
DCloud-yyl 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
import { AddPhoneContactOptions } from './interface.uts';
export const API_ADD_PHONE_CONTACT = 'addPhoneContact'

export const AddPhoneContactApiOptions: ApiOptions<AddPhoneContactOptions> = {
  formatArgs: new Map<string, ((firstName: string) => string | undefined)>([
    ['firstName', function (firstName: string) {
      if (!firstName) {
        return 'addPhoneContact:fail parameter error: parameter.firstName should not be empty;'
      }
      return undefined
    }]
  ])
}


export const AddPhoneContactApiProtocol = new Map<string, ProtocolOptions>([
  ['firstName', { type: 'string', required: true }],
  ['photoFilePath', { type: 'string' }],
  ['nickName', { type: 'string' }],
  ['lastName', { type: 'string' }],
  ['middleName', { type: 'string' }],
  ['remark', { type: 'string' }],
  ['mobilePhoneNumber', { type: 'string' }],
  ['weChatNumber', { type: 'string' }],
  ['addressCountry', { type: 'string' }],
  ['addressState', { type: 'string' }],
  ['addressCity', { type: 'string' }],
  ['addressStreet', { type: 'string' }],
  ['addressPostalCode', { type: 'string' }],
  ['organization', { type: 'string' }],
  ['title', { type: 'string' }],
  ['workFaxNumber', { type: 'string' }],
  ['workPhoneNumber', { type: 'string' }],
  ['hostNumber', { type: 'string' }],
  ['email', { type: 'string' }],
  ['url', { type: 'string' }],
  ['workAddressCountry', { type: 'string' }],
  ['workAddressState', { type: 'string' }],
  ['workAddressCity', { type: 'string' }],
  ['workAddressStreet', { type: 'string' }],
  ['workAddressPostalCode', { type: 'string' }],
  ['homeFaxNumber', { type: 'string' }],
  ['homePhoneNumber', { type: 'string' }],
  ['homeAddressCountry', { type: 'string' }],
  ['homeAddressState', { type: 'string' }],
  ['homeAddressCity', { type: 'string' }],
  ['homeAddressStreet', { type: 'string' }],
  ['homeAddressPostalCode', { type: 'string' }]
]
);