Example #1
0
        public async Task GetAllSessions()
        {
            var api      = new ConferenceApi(_httpClient);
            var sessions = await api.GetAllSessions();

            Assert.True(sessions.Count > 0);
        }
Example #2
0
        public async Task GetAllSpeakers()
        {
            var api = await ConferenceApi.CreateConferenceApi(_httpClient);

            var speakers = await api.GetAllSpeakers();

            Assert.True(speakers.Count > 0);
        }
Example #3
0
        public async Task MakeMultipleRequests()
        {
            var api      = new ConferenceApi();
            var speakers = await api.GetAllSpeakers();

            foreach (var speakerDto in speakers)
            {
                var sessions = await api.GetSessionsBySpeakerName(speakerDto.Name);    // Don't have Id... why not?
            }
        }
Example #4
0
        public ConferenceApiService(IOptions <ConferenceApi> opts, IHttpClientFactory httpFactory)
        {
            _confApiConfig = opts.Value;
            _httpFactory   = httpFactory;

            _client = _httpFactory.CreateClient("ConferenceApiClient");
            _client.DefaultRequestHeaders.Add("Ocp-Apim-Subscription-Key", _confApiConfig.AuthKey);
            _client.DefaultRequestHeaders.Add("Cache-Control", "no-cache");
            _client.DefaultRequestHeaders.Add("Api-version", "v1");
        }
 private void SetupApis()
 {
     Error = new ErrorApi {
         Client = this
     };
     Account = new AccountApi {
         Client = this
     };
     Application = new ApplicationApi {
         Client = this
     };
     AvailableNumber = new AvailableNumberApi {
         Client = this
     };
     Bridge = new BridgeApi {
         Client = this
     };
     Domain = new DomainApi {
         Client = this
     };
     Call = new CallApi {
         Client = this
     };
     Conference = new ConferenceApi {
         Client = this
     };
     Message = new MessageApi {
         Client = this
     };
     NumberInfo = new NumberInfoApi {
         Client = this
     };
     PhoneNumber = new PhoneNumberApi {
         Client = this
     };
     Recording = new RecordingApi {
         Client = this
     };
     Transcription = new TranscriptionApi {
         Client = this
     };
     Media = new MediaApi {
         Client = this
     };
     Endpoint = new EndpointApi {
         Client = this
     };
     V2 = new ApiV2 {
         Message = new Bandwidth.Net.ApiV2.MessageApi {
             Client = this
         }
     };
 }
Example #6
0
 public async Task GetSessionsBySpeaker()
 {
     var api      = new ConferenceApi();
     var sessions = await api.GetSessionsBySpeaker(34);
 }
Example #7
0
 public async Task GetAllSessions()
 {
     var api      = new ConferenceApi();
     var sessions = await api.GetAllSessions();
 }
Example #8
0
 public async Task GetAllSpeakers()
 {
     var api      = new ConferenceApi();
     var speakers = await api.GetAllSpeakers();
 }