/// <summary> /// Initializes a new instance of the ContentManagementService class /// </summary> /// <param name="configuration">Reference to the <see cref="IPasswordBasedConfiguration"/></param> public ContentManagementService(IPasswordBasedConfiguration configuration) { var httpClient = new HttpClient(new AuthenticatedHttpClientHandler(configuration)) { BaseAddress = new Uri(Constants.Urls.BaseApiUrl) }; var refitSettings = CreateRefitSettings(); Content = new ContentService(configuration, httpClient, refitSettings); DocumentType = new DocumentTypeService(configuration, httpClient, refitSettings); Forms = new FormService(configuration, httpClient, refitSettings); Language = new LanguageService(configuration, httpClient, refitSettings); Media = new MediaService(configuration, httpClient, refitSettings); MediaType = new MediaTypeService(configuration, httpClient, refitSettings); Member = new MemberService(configuration, httpClient, refitSettings); MemberGroup = new MemberGroupService(configuration, httpClient, refitSettings); MemberType = new MemberTypeService(configuration, httpClient, refitSettings); Relation = new RelationService(configuration, httpClient, refitSettings); RelationType = new RelationTypeService(configuration, httpClient, refitSettings); }
/// <summary> /// Initializes a new instance of the ContentManagementService class /// </summary> /// <param name="configuration">Reference to the <see cref="IApiKeyBasedConfiguration"/></param> public ContentManagementService(IApiKeyBasedConfiguration configuration) { var httpClient = new HttpClient { BaseAddress = new Uri(Constants.Urls.BaseApiUrl), DefaultRequestHeaders = { { Constants.Headers.ApiKey, configuration.Token } } }; var refitSettings = CreateRefitSettings(); Content = new ContentService(configuration, httpClient, refitSettings); DocumentType = new DocumentTypeService(configuration, httpClient, refitSettings); Forms = new FormService(configuration, httpClient, refitSettings); Language = new LanguageService(configuration, httpClient, refitSettings); Media = new MediaService(configuration, httpClient, refitSettings); MediaType = new MediaTypeService(configuration, httpClient, refitSettings); Member = new MemberService(configuration, httpClient, refitSettings); MemberGroup = new MemberGroupService(configuration, httpClient, refitSettings); MemberType = new MemberTypeService(configuration, httpClient, refitSettings); Relation = new RelationService(configuration, httpClient, refitSettings); RelationType = new RelationTypeService(configuration, httpClient, refitSettings); }