コード例 #1
0
ファイル: Step3.cs プロジェクト: sameerinfodb/conference-api
        public async Task GetAllSessions()
        {
            var api      = new ConferenceApi(_httpClient);
            var sessions = await api.GetAllSessions();

            Assert.True(sessions.Count > 0);
        }
コード例 #2
0
ファイル: Step3.cs プロジェクト: sameerinfodb/conference-api
        public async Task GetAllSpeakers()
        {
            var api = await ConferenceApi.CreateConferenceApi(_httpClient);

            var speakers = await api.GetAllSpeakers();

            Assert.True(speakers.Count > 0);
        }
コード例 #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?
            }
        }
コード例 #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");
        }
コード例 #5
0
 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
         }
     };
 }
コード例 #6
0
 public async Task GetSessionsBySpeaker()
 {
     var api      = new ConferenceApi();
     var sessions = await api.GetSessionsBySpeaker(34);
 }
コード例 #7
0
 public async Task GetAllSessions()
 {
     var api      = new ConferenceApi();
     var sessions = await api.GetAllSessions();
 }
コード例 #8
0
 public async Task GetAllSpeakers()
 {
     var api      = new ConferenceApi();
     var speakers = await api.GetAllSpeakers();
 }