Example #1
0
 public async Task DelNonExistingContactCsv()
 {
     Console.WriteLine(DelContact.FromCsv(await Client.Contacts(new ContactsParams {
         Action = ContactsAction.del,
         Id     = 51341255,
     })));
 }
Example #2
0
 public async Task DelContactCsv()
 {
     Console.WriteLine(DelContact.FromCsv(await Client.Contacts(new ContactsParams {
         Action = ContactsAction.del,
         Id     = 13513516
     })));
 }
Example #3
0
 public async Task DelNonExistingContactCsv()
 {
     AssertDelNonExistingContact(DelContact.FromCsv(await BaseTest.Client.Contacts(new ContactsParams {
         Action = ContactsAction.del,
         Id     = NonExistingContactId,
     })));
 }
Example #4
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)
            });