コード例 #1
0
 public async Task WriteContactCsv()
 {
     Console.WriteLine(WriteContact.FromCsv(await Client.Contacts(new ContactsParams {
         Action     = ContactsAction.write,
         Email      = "*****@*****.**",
         Empfaenger = "004901234567890",
         Nick       = "Peter Pan"
     })));
 }
コード例 #2
0
 public async Task EditContactCsv()
 {
     AssertWriteContact(WriteContact.FromCsv(await BaseTest.Client.Contacts(new ContactsParams {
         Action     = ContactsAction.write,
         Email      = "*****@*****.**",
         Empfaenger = "+4901234567890",
         Nick       = "PeterPan",
         Id         = WriteEditContactId
     })));
 }
コード例 #3
0
        public async Task <dynamic> Contacts(ContactsParams @params)
        {
            HttpMethod httpMethod = ContactsAction.read == @params.Action ? HttpMethod.Get : HttpMethod.Post;
            string     method     = Library.Util.ToTitleCase(httpMethod.Method);

            object[] paras    = { "contacts", @params };
            var      response = await CallDynamicMethod(method, paras);

            if ([email protected])
            {
                return(response);
            }

            return(@params.Action switch
            {
                ContactsAction.write => WriteContact.FromCsv(response),
                ContactsAction.del => DelContact.FromCsv(response),
                _ => JsonConvert.DeserializeObject <Contact[]>(response)
            });