Наследование: CallfireApiClient.Api.Campaigns.Model.Recipient
        public void SendCall()
        {
            var contacts = Client.ContactsApi.Find(new FindContactsRequest());

            var recipient1 = new CallRecipient { ContactId = contacts.Items[0].Id, LiveMessage = "testMessage", TransferDigit = "1", TransferMessage = "transferTestMessage", TransferNumber = "14246525473" };
            var recipient2 = new CallRecipient { ContactId = contacts.Items[0].Id, LiveMessage = "testMessage", TransferDigit = "1", TransferMessageSoundId = 1, TransferNumber = "14246525473" };
            var recipients = new List<CallRecipient> { recipient1, recipient2 };

            IList<Call> calls = Client.CallsApi.Send(recipients, null, "items(id,fromNumber,state)");
            Console.WriteLine("Calls: " + calls);

            Assert.AreEqual(2, calls.Count);
            Assert.NotNull(calls[0].Id);
            Assert.IsNull(calls[0].CampaignId);
            Assert.AreEqual(StateType.READY, calls[0].State);

            var request = new SendCallsRequest
            {
                Recipients = recipients,
                CampaignId = 7373471003,
                Fields = "items(id, fromNumber, state, campaignId)",
                DefaultLiveMessage = "DefaultLiveMessage",
                DefaultMachineMessage = "DefaultMachineMessage",
                DefaultVoice = CallfireApiClient.Api.Campaigns.Model.Voice.FRENCHCANADIAN1
            };
            calls = Client.CallsApi.Send(request);
            Assert.AreEqual(2, calls.Count);
            Assert.AreEqual(calls[0].CampaignId, 7373471003);

            request = new SendCallsRequest
            {
                Recipients = recipients,
                CampaignId = 7373471003,
                Fields = "items(id, fromNumber, state, campaignId)",
                DefaultLiveMessageSoundId = 1,
                DefaultMachineMessageSoundId = 1,
                DefaultVoice = CallfireApiClient.Api.Campaigns.Model.Voice.FRENCHCANADIAN1
            };
            calls = Client.CallsApi.Send(request);
            Assert.AreEqual(2, calls.Count);
        }
        public void SendCallsUsingRequest()
        {
            string requestJson = GetJsonPayload("/callstexts/callsApi/request/sendCalls.json");
            string responseJson = GetJsonPayload("/callstexts/callsApi/response/sendCalls.json");
            var restRequest = MockRestResponse(responseJson);

            CallRecipient r1 = new CallRecipient { PhoneNumber = "12135551100", LiveMessage = "Why hello there!", TransferDigit = "1", TransferMessage = "testMessage", TransferNumber = "12135551101" };
            CallRecipient r2 = new CallRecipient { PhoneNumber = "12135551101", LiveMessage = "And hello to you too." };

            var request = new SendCallsRequest
            {
                Recipients = new List<CallRecipient> { r1, r2 },
                CampaignId = 10,
                Fields = FIELDS,
                DefaultLiveMessage = "DefaultLiveMessage",
                DefaultMachineMessage = "DefaultMachineMessage",
                DefaultLiveMessageSoundId = 1,
                DefaultMachineMessageSoundId = 1,
                DefaultVoice = CallfireApiClient.Api.Campaigns.Model.Voice.FRENCHCANADIAN1
            };

            IList<Call> calls = Client.CallsApi.Send(request);

            Assert.That(Serializer.Serialize(new ListHolder<Call>(calls)), Is.EqualTo(responseJson));
            Assert.AreEqual(Method.POST, restRequest.Value.Method);
            var requestBodyParam = restRequest.Value.Parameters.FirstOrDefault(p => p.Type == ParameterType.RequestBody);
            Assert.That(requestBodyParam.Value, Is.EqualTo(requestJson));

            calls = Client.CallsApi.Send(new List<CallRecipient> { r1, r2 }, 10, FIELDS);
            Assert.That(restRequest.Value.Resource, !Is.StringContaining("fields" + FIELDS));
            Assert.That(restRequest.Value.Resource, !Is.StringContaining("campaignId=10"));
            Assert.That(restRequest.Value.Resource, !Is.StringContaining("defaultLiveMessage=DefaultLiveMessage"));
            Assert.That(restRequest.Value.Resource, !Is.StringContaining("defaultMachineMessage=DefaultMachineMessage"));
            Assert.That(restRequest.Value.Resource, !Is.StringContaining("defaultLiveMessageSoundId=1"));
            Assert.That(restRequest.Value.Resource, !Is.StringContaining("defaultMachineMessageSoundId=1"));
            Assert.That(restRequest.Value.Resource, !Is.StringContaining("defaultMachineMessageSoundId=1"));
            Assert.That(restRequest.Value.Resource, !Is.StringContaining("defaultVoice=FRENCHCANADIAN1"));
        }